我碰到了一个问题:在我的逻辑库中,混有dirty的数据集,请问我应该怎样清除?
问题如下
逻辑库Data当中,正常的数据集是sh000001-600000.但是,有的数据集名称为sh0a0001。就是后面应该是数字的部分低二位中间混有字符。
这种数据集是需要清除的。
请问我用程序怎么实现?
我觉得就是怎么获取变量名的问题。
谢谢!

|
楼主: liu022
|
4456
10
请教清除逻辑库中的数据集收索方法 |
|
已卖:181份资源 讲师 64%
-
|
回帖推荐honghejing 发表于2楼 查看完整内容 可以用macro来做,将每个dataset名赋给macro变量,然后判断macro变量的值是否在sh000001-600000之间
proc datasets lib=libname1 ;
contents out=dsn(keep=MEMNAME where =(input(sbustr(MEMNAME,3,6),6.)600000)) noprint;
run;
quit;
proc sql;
select distinct MEMNAME into : dsn SEPARATED by ' ' from dsn
;
quit;
%macro scanloop;
%let counter=1;
%do %while(%scan(&dsn,&counter,%str( )) NE );
...
本帖被以下文库推荐
| ||
|
|
| ||
| ||
|
Let them be hard, but never unjust
|
||
| ||
|
Let them be hard, but never unjust
|
||
| ||
加好友,备注cda京ICP备16021002号-2 京B2-20170662号
京公网安备 11010802022788号
论坛法律顾问:王进律师
知识产权保护声明
免责及隐私声明


