全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1049 4
2015-02-25
悬赏 20 个论坛币 未解决
data aaa;
label x="xx";
input x y;
cards;
1 2
1 2
;
run;

data _null_;
        if 0 then set aaa;
        call symput ('label1', Vlabel(x));
        call symput ('label2', Vlabel(y));
run;

%put &label1;
%put &label2;

y变量标签为空,但label2解析出来为y,如何得到label2为空呢?谢谢!
二维码

扫码加我 拉你入群

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

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

全部回复
2015-2-26 09:53:50
Instead of using vlabel() function, you can use the output dataset from proc contents. JingJu
二维码

扫码加我 拉你入群

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

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

2015-2-26 12:49:59
Or get information from sashelp.vcolumn:
proc sql noprint;
   select label into :label1 from sashelp.vcolumn where libname='WORK' & memname='AAA' & upcase(name)='X';
   select label into :label2 from sashelp.vcolumn where libname='WORK' & memname='AAA' & upcase(name)='Y';
quit;
二维码

扫码加我 拉你入群

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

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

2015-2-28 10:03:55
Please try the following code:

%let dsid=%sysfunc(open(aaa,i));
%let label1 = %sysfunc(varlabel(&dsid.,1));
%let label2 = %sysfunc(varlabel(&dsid.,2));

%put +++&label1++;
%put +++&label2++;
二维码

扫码加我 拉你入群

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

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

2015-3-3 12:00:58
wpfwxn 发表于 2015-2-28 10:03
Please try the following code:

%let dsid=%sysfunc(open(aaa,i));
thanks. Good point. 京剧
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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