全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1157 1
2009-12-01
各位大侠,请指教!下面的程序里面,我自己认为没有错误,为什么每次运行的时候,都提示我D:\WORLDSCOPE\INT-&N.txt不存在呢?
请各位告诉可以吗,我怎么试验都不可以


%macro MTEST(N);
%do i=1 %to &N;
data WORK.int&N ;
       %let _EFIERR_ = 0; /* set the ERROR detection macro variable */
       infile 'D:\WORLDSCOPE\INT-&N.txt' delimiter='09'x MISSOVER DSD lrecl=32767  firstobs=2 ;
          informat ______________00100000____001001 $97. ;
          format ______________00100000____001001 $97. ;
          input     ______________00100000____001001 $   ;
       if _ERROR_ then call symputx('_EFIERR_',1);  /* set ERROR detection macro variable */
run;
data mysas.int&N;
length wscode $9  year$4  frequency$1 field$5 value1$19 value2$3 currency$3;
set int&N(rename=(______________00100000____001001=temp));
wscode=substr(temp,1,9);
year=substr(temp,10,4);
frequency=substr(temp,14,1);
field=substr(temp,18,5);
value1=substr(temp,52,19);
value2=substr(temp,71,3);
currency=substr(temp,92,3);
keep wscode year frequency field value1 value2 currency;
run;
%end;
%mend MTEST;
%MTEST(7)
二维码

扫码加我 拉你入群

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

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

全部回复
2009-12-2 01:21:10

infile 'D:\WORLDSCOPE\INT-&N.txt' delimiter='09'x MISSOVER DSD lrecl=32767  firstobs=2;
用双引号吧.还要多一个小点吧。
另外,那个&i 有什么用处呢?
复制代码
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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