全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1677 2
2014-01-03
data _caldates; set _caldates;
    n+1;
    if intnx('month',beg_date,0,'e')=
    intnx('month',"&mindate"d,0,'e') then call symput ('start',n);
    if intnx('month',end_date,0,'e')=
    intnx('month',"&maxdate"d,0,'e') then call symput ('finish',n);
  run;

  %do j=&start %to &finish %by &step;

   data _null_; set _caldates (sortedby=n where=(n=&j));
    call symput ('beg',beg_date);
   run;

  data _null_; set _caldates (sortedby=n where=(n=&j));
  call symput ('end',end_date);
   run;

   data _sample/view=_sample;
     do k=1 by 1 until (last.permno);
      set _vol; by permno;
      where &beg<=date<&end;
      if missing(ret) then continue;
      mcount=sum(mcount,1);
    end;
   keep permno mcount;
   run;

这段程序为什么用call symput 定义的 start finish beg和end好像不工作那?谢谢各位帮助

二维码

扫码加我 拉你入群

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

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

全部回复
2014-1-3 09:31:55
兄弟,%do j=&start %to &finish %by &step; 后面的这两段是要放进宏里面的,帮你改一下吧。
复制代码
二维码

扫码加我 拉你入群

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

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

2014-1-3 13:59:25
heperwong 发表于 2014-1-3 09:31
兄弟,%do j=&start %to &finish %by &step; 后面的这两段是要放进宏里面的,帮你改一下吧。
谢谢热心帮助,改过以后可以跑了:)
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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