I can't test this at the moment, but need to know what the result of the following code would be:
data test;
set sashelp.class;
label height='Height in cm';
run;
proc sql noprint;
select label
into :vlabels separated by "~"
from dictionary.columns
where libname="WORK" and
memname="TEST"
;
quit;
%put &vlabels.;
I'd very much appreciate it if one of you would run that code and post the value (from your log) that appears for &vlabels.;
TIA,
Art
Hi,
I got this log:
data test;
17 set sashelp.class;
18 label height='Height in cm';
19 run;
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.TEST has 19 observations and 5 variables.
NOTE: DATA statement used:
real time 0.02 seconds
cpu time 0.01 seconds
20
21 proc sql noprint;
22 select label
23 into :vlabels separated by "~"
24 from dictionary.columns
25 where libname="WORK" and
26 memname="TEST"
27 ;
28 quit;
NOTE: PROCEDURE SQL used:
real time 0.01 seconds
cpu time 0.01 seconds
29
30 %put &vlabels.;
~~~Height in cm~
92 data test;
93 set sashelp.class;
94 label height='Height in cm';
95 run;
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.TEST has 19 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds
96
97 proc sql noprint;
98 select label
99 into :vlabels separated by "~"
100 from dictionary.columns
101 where libname="WORK" and
102 memname="TEST"
103 ;
104 quit;
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
105
106 %put &vlabels.;
~~~Height in cm~
Hi,
I got this log:
data test;
17 set sashelp.class;
18 label height='Height in cm';
19 run;
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.TEST has 19 observations and 5 variables.
NOTE: DATA statement used:
real time 0.02 seconds
cpu time 0.01 seconds
20
21 proc sql noprint;
22 select label
23 into :vlabels separated by "~"
24 from dictionary.columns
25 where libname="WORK" and
26 memname="TEST"
27 ;
28 quit;
NOTE: PROCEDURE SQL used:
real time 0.01 seconds
cpu time 0.01 seconds
29
30 %put &vlabels.;
~~~Height in cm~
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.