SAS中文论坛

 找回密码
 立即注册

扫一扫,访问微社区

查看: 849|回复: 1
打印 上一主题 下一主题

银行客户分析中的细节问题

[复制链接]

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
楼主
 楼主| 发表于 2005-12-4 18:43:12 | 只看该作者

银行客户分析中的细节问题

请各位大侠看看这段程序有没有问题呀,谢谢关注,我在线期待!
需求:把客户身份证中的出生年月和开户时候填的出生年月不一致的客户踢去。
data work.cannotpass;
set work.test1123;
if length(compbl(ID))=15  then IDbirth = '19'||substr(compbl(ID),6,<6>);
else if  length(compbl(ID))=18 then  IDbirth = substr(compbl(ID),6,<8>);
if IDbirth ^= 'birthtime';
run;
其中ID,birthtime都是$型,程序运行后error:
1194  data work.cannotpass;
1195  set work.test1123;
NOTE: SCL source line.
1196  if length(compbl(ID))=15  then IDbirth = '19'||substr(compbl(ID),6,<6>);
                                                                         -
                                                                         22
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,
              a numeric constant, a datetime constant, a missing value, ), INPUT, PUT.

1196! if length(compbl(ID))=15  then IDbirth = '19'||substr(compbl(ID),6,<6>);
                                                                            -
                                                                            22
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,
              a numeric constant, a datetime constant, a missing value, bitstring, INPUT, PUT.

NOTE: SCL source line.
1197  else if  length(compbl(ID))=18 then  IDbirth = substr(compbl(ID),6,<8>);
                                                                         -
                                                                         22
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,
              a numeric constant, a datetime constant, a missing value, ), INPUT, PUT.

1197! else if  length(compbl(ID))=18 then  IDbirth = substr(compbl(ID),6,<8>);
                                                                            -
                                                                            22
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,
              a numeric constant, a datetime constant, a missing value, bitstring, INPUT, PUT.

1198  if IDbirth ^= 'birthtime';
1199  run;

NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
      0:-1                                     <no line/column information available>
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.CANNOTPASS may be incomplete.  When this step was stopped there were 0
         observations and 37 variables.
WARNING: Data set WORK.CANNOTPASS was not replaced because this step was stopped.
NOTE: DATA statement used:
      real time           0.03 seconds
      cpu time            0.03 seconds


1200  proc sort data=work.cannotpas;
1201  by birthtime ;

NOTE: Input data set is empty.
NOTE: The data set WORK.CANNOTPASS has 0 observations and 37 variables.
NOTE: PROCEDURE SORT used:
      real time           0.00 seconds
      cpu time            0.00 seconds
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
沙发
 楼主| 发表于 2006-3-4 14:40:47 | 只看该作者

银行客户分析中的细节问题

data countpass;
set testcount;
if length(compbl(id))=15 then IDbirth = '19'||substr(compbl(ID),7,6);
else if length(compbl(ID))=18 then IDbirth = substr(compbl(ID),7,8);
if IDbirth=birthday then output;
run;

Perhaps, syntax error happen on calling substr. try again.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SAS中文论坛  

GMT+8, 2025-6-9 18:22 , Processed in 0.113729 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表