全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
3945 4
2016-08-26
悬赏 5 个论坛币 已解决
如题,哪位大神可以帮忙解答一下。因为生成的数据集名字比较混乱,没法像set dat1-dat100这样合并。

最佳答案

wwang111 查看完整内容

libname aaa "your-dataset-path"; data _null_; set sashelp.vtable end=last; where libname="AAA"; if _n_=1 then call execute("data wanted; set aaa."||strip(memname)); else call execute("aaa."||strip(memname)); if last then call execute(";run;") ; run;
二维码

扫码加我 拉你入群

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

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

全部回复
2016-8-26 20:33:01
libname aaa "your-dataset-path";
data _null_;
set sashelp.vtable end=last;
  where libname="AAA";
    if _n_=1 then call execute("data wanted; set aaa."||strip(memname));
     else call execute("aaa."||strip(memname));
    if last then call execute(";run;") ;
run;
二维码

扫码加我 拉你入群

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

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

2016-8-26 22:12:58
wwang111 发表于 2016-8-26 21:15
libname aaa "your-dataset-path";
data _null_;
set sashelp.vtable end=last;
非常感谢回复,我试了:
data _null_;
set sashelp.vtable end=last;
where libname="temp";
if _n_=1 then call execute("data wanted; set temp."||strip(memname));
else call execute("temp."||strip(memname));
if last then call execute(";run;") ;
run;
/*-----------------------------------------------------------------------------------------------------------------*/
结果:
data _null_;
77   set sashelp.vtable end=last;
78   where libname="temp";
79   if _n_=1 then call execute("data wanted; set temp."||strip(memname));
80   else call execute("temp."||strip(memname));
81   if last then call execute(";run;") ;
82   run;

NOTE: 从数据集 SASHELP.VTABLE. 读取了 0 个观测
      WHERE libname='temp';
NOTE: “DATA 语句”所用时间(总处理时间):
      实际时间          1.01 秒
      CPU 时间          1.01 秒
/*-----------------------------------------------------------------------------------------------------------------*/
不知道哪里出了问题?
二维码

扫码加我 拉你入群

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

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

2016-8-26 22:35:59
where libname="TEMP"; 这里需要大写
二维码

扫码加我 拉你入群

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

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

2016-8-26 23:03:01
wwang111 发表于 2016-8-26 22:35
where libname="TEMP"; 这里需要大写
非常感谢~
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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