全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1440 5
2015-04-15
悬赏 50 个论坛币 未解决
求一段MACRO解决下面这两段代码。谢谢阿!
data checklog.fs000_check1        checklog.fs000_check2        checklog.fs000_check3        checklog.fs000_check4        checklog.fs000_check5       
checklog.fs000_check6        checklog.fs000_check7        checklog.fs000_check8        checklog.fs000_check9        checklog.fs000_check10       
checklog.fs000_check11        checklog.fs000_check12        checklog.fs000_check13        checklog.fs000_check14        checklog.fs000_check15       
checklog.fs000_check16        checklog.fs000_check17        checklog.fs000_check18        checklog.fs000_check19        checklog.fs000_check20       
checklog.fs000_check21        checklog.fs000_check22        checklog.fs000_check23        checklog.fs000_check24        checklog.fs000_check25       
checklog.fs000_check26        checklog.fs000_check27        checklog.fs000_check28        checklog.fs000_check29        checklog.fs000_check30       
checklog.fs000_check31        checklog.fs000_check33        checklog.fs000_check34        checklog.fs000_check35       
checklog.fs000_check36        checklog.fs000_check38        checklog.fs000_check39        checklog.fs000_check40       
checklog.fs000_check41        checklog.fs000_check42        checklog.fs000_check43        checklog.fs000_check44        checklog.fs000_check45       
checklog.fs000_check46        checklog.fs000_check47        ;
set fs000_y_cus_cl;
if _000101 < 0  and _000101 ne '.' then output checklog.fs000_check1;
if _000135 < 0  and _000135 ne '.' then output checklog.fs000_check2;
if _000155 < 0  and _000155 ne '.' then output checklog.fs000_check3;
if _000173 < 0  and _000173 ne '.' then output checklog.fs000_check4;
if _000184 < 0  and _000184 ne '.' then output checklog.fs000_check5;
if _000193 < 0  and _000193 ne '.' then output checklog.fs000_check6;
if _000201 < 0  and _000201 ne '.' then output checklog.fs000_check7;
if _000202 < 0  and _000202 ne '.' then output checklog.fs000_check8;
if _000102 < 0  and _000102 ne '.' then output checklog.fs000_check9;
if _000105 < 0  and _000105 ne '.' then output checklog.fs000_check10;
if _000109 < 0  and _000109 ne '.' then output checklog.fs000_check11;
if _000112 < 0  and _000112 ne '.' then output checklog.fs000_check12;
if _000119 < 0  and _000119 ne '.' then output checklog.fs000_check13;
if _000122 < 0  and _000122 ne '.' then output checklog.fs000_check14;
if _000126 < 0  and _000126 ne '.' then output checklog.fs000_check15;
if _000137 < 0  and _000137 ne '.' then output checklog.fs000_check16;
if _000140 < 0  and _000140 ne '.' then output checklog.fs000_check17;
if _000139 < 0  and _000139 ne '.' then output checklog.fs000_check18;
if _000151 < 0  and _000151 ne '.' then output checklog.fs000_check19;
if _000149 < 0  and _000149 ne '.' then output checklog.fs000_check20;
if _000154 < 0  and _000154 ne '.' then output checklog.fs000_check21;
if _000146 < 0  and _000146 ne '.' then output checklog.fs000_check22;
if _000152 < 0  and _000152 ne '.' then output checklog.fs000_check23;
if _000123 < 0  and _000123 ne '.' then output checklog.fs000_check24;
if _000103 < 0  and _000103 ne '.' then output checklog.fs000_check25;
if _000125 < 0  and _000125 ne '.' then output checklog.fs000_check26;
if _000129 < 0  and _000129 ne '.' then output checklog.fs000_check27;
if _000160 < 0  and _000160 ne '.' then output checklog.fs000_check28;
if _000159 < 0  and _000159 ne '.' then output checklog.fs000_check29;
if _000161 < 0  and _000161 ne '.' then output checklog.fs000_check30;
if _000170 < 0  and _000170 ne '.' then output checklog.fs000_check31;
if _000171 < 0  and _000171 ne '.' then output checklog.fs000_check33;
if _000172 < 0  and _000172 ne '.' then output checklog.fs000_check34;
if _000175 < 0  and _000175 ne '.' then output checklog.fs000_check35;
if _000177 < 0  and _000177 ne '.' then output checklog.fs000_check36;
if _000179 < 0  and _000179 ne '.' then output checklog.fs000_check38;
if _000181 < 0  and _000181 ne '.' then output checklog.fs000_check39;
if _000183 < 0  and _000183 ne '.' then output checklog.fs000_check40;
if _000188 < 0  and _000188 ne '.' then output checklog.fs000_check41;
if _000189 < 0  and _000189 ne '.' then output checklog.fs000_check42;
if _000206 < 0  and _000206 ne '.' then output checklog.fs000_check43;
if _000207 < 0  and _000207 ne '.' then output checklog.fs000_check44;
if _000213 < 0  and _000213 ne '.' then output checklog.fs000_check45;
if _000214 < 0  and _000214 ne '.' then output checklog.fs000_check46;
if _000215 < 0  and _000215 ne '.' then output checklog.fs000_check47;
run;
data checklog.fs001_check1        checklog.fs001_check2        checklog.fs001_check3       
checklog.fs001_check4        checklog.fs001_check5        checklog.fs001_check6       
checklog.fs001_check7        checklog.fs001_check8        checklog.fs001_check9       
checklog.fs001_check10        checklog.fs001_check11        checklog.fs001_check12
checklog.fs001_check14        checklog.fs001_check15        checklog.fs001_check17       
checklog.fs001_check18        checklog.fs001_check22        checklog.fs001_check23       
checklog.fs001_check28        checklog.fs001_check29        checklog.fs001_check30               
checklog.fs001_check32        checklog.fs001_check34        checklog.fs001_check35       
checklog.fs001_check36        checklog.fs001_check37        checklog.fs001_check41       
checklog.fs001_check42        checklog.fs001_check44        checklog.fs001_check46       
checklog.fs001_check47        checklog.fs001_check48;
set fs001_y_cus_cl;
if _001119 <0 and _001119 ne "." then output checklog.fs001_check1;
if _001127 <0 and _001127 ne "." then output checklog.fs001_check2;
if _001140 <0 and _001140 ne "." then output checklog.fs001_check3;
if _001164 <0 and _001164 ne "." then output checklog.fs001_check4;
if _001174 <0 and _001174 ne "." then output checklog.fs001_check5;
if _001186 <0 and _001186 ne "." then output checklog.fs001_check6;
if _001202 <0 and _001202 ne "." then output checklog.fs001_check7;
if _001206 <0 and _001206 ne "." then output checklog.fs001_check8;
if _001102 <0 and _001102 ne "." then output checklog.fs001_check9;
if _001106 <0 and _001106 ne "." then output checklog.fs001_check10;
if _001107 <0 and _001107 ne "." then output checklog.fs001_check11;
if _001108 <0 and _001108 ne "." then output checklog.fs001_check12;
if _001116 <0 and _001116 ne "." then output checklog.fs001_check14;
if _001118 <0 and _001118 ne "." then output checklog.fs001_check15;
if _001128 <0 and _001128 ne "." then output checklog.fs001_check17;
if _001130 <0 and _001130 ne "." then output checklog.fs001_check18;
if _001133 <0 and _001133 ne "." then output checklog.fs001_check22;
if _001136 <0 and _001136 ne "." then output checklog.fs001_check23;
if _001149 <0 and _001149 ne "." then output checklog.fs001_check28;
if _001148 <0 and _001148 ne "." then output checklog.fs001_check29;
if _001150 <0 and _001150 ne "." then output checklog.fs001_check30;
if _001170 <0 and _001170 ne "." then output checklog.fs001_check32;
if _001163 <0 and _001163 ne "." then output checklog.fs001_check34;
if _001166 <0 and _001166 ne "." then output checklog.fs001_check35;
if _001168 <0 and _001168 ne "." then output checklog.fs001_check36;
if _001169 <0 and _001169 ne "." then output checklog.fs001_check37;
if _001177 <0 and _001177 ne "." then output checklog.fs001_check41;
if _001179 <0 and _001179 ne "." then output checklog.fs001_check42;
if _001216 <0 and _001216 ne "." then output checklog.fs001_check44;
if _001224 <0 and _001224 ne "." then output checklog.fs001_check46;
if _001225 <0 and _001225 ne "." then output checklog.fs001_check47;
if _001125 <0 and _001125 ne "." then output checklog.fs001_check48;
run;

数据集的名称不能更改,因为我是按照检查规则进行命名的,所以共48条规则。谢谢!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2015-4-15 21:19:15
if中的两个数没有规律么..
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-4-16 09:07:01
吕小布韦 发表于 2015-4-15 21:19
if中的两个数没有规律么..
没有规律。。。我认为是可以做一个varlist解决。。。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-4-17 12:59:30
求大神指导阿!!!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-4-17 13:36:01
很简单的问题啊,做成宏变量就行了
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-4-19 13:10:08
%macro subset(condvar=,input=,output=);
data &output;
set &input;
if &condvar not in (0,.) then output;
run;
%mend;
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群