全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
7582 16
2012-11-10
_all_表示所有变量的名称,但是我要怎么查看和使用呢?
比如说想统计一下变量的个数,应该怎么操作呢?谢谢!
二维码

扫码加我 拉你入群

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

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

全部回复
2012-11-10 19:14:42
These option has many function.
For example, "put _ALL_ "writes the values of all variables, which includes automatic variables, that are defined in the current DATA step by using named output.

data a;
do i= 1 to 5;
x=sqrt(i);
output;
put _all_;
end;
run;
二维码

扫码加我 拉你入群

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

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

2012-11-10 19:37:41
davil2000 发表于 2012-11-10 19:14
These option has many function.
For example, "put _ALL_ "writes the values of all variables, which ...
谢谢!那应该怎么统计有多少个变量呢?(不含自动变量……)
本来是想在宏里面用dim(array)来统计的……结果后来发现宏里面不能用array啊……
https://bbs.pinggu.org/forum.php? ... =2130886&extra=
二维码

扫码加我 拉你入群

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

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

2012-11-10 20:03:55
若水烟寒 发表于 2012-11-10 19:37
谢谢!那应该怎么统计有多少个变量呢?(不含自动变量……)
本来是想在宏里面用dim(array)来统计的…… ...
really?

%macro name;
data _null_;
array r(2) x y (1,2);
put _all_;
put 'r(1)='r(1) ' r(2)='r(2);
run;
%mend name;
%name;
二维码

扫码加我 拉你入群

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

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

2012-11-10 20:10:51
在ODS中也可以用_all_来关闭所有输出方式,如 ods _all_ close;
二维码

扫码加我 拉你入群

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

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

2012-11-10 20:18:12
data _null_;
   dsid=open("sashelp.prdsale");
   xxx=attrn(dsid,"nvars");
   put  "the number of variables is " xxx;
run;
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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