i want to print the variable names based on alphabetical order..
can you suggest any one????
thanks..
Here is one way:
proc sql noprint;
select name
into :reorder
separated by ' '
from dictionary.columns
where libname="SASHELP" and
memname="CLASS"
order by name
;
quit;
proc print data=sashelp.class;
var &reorder.;
run;
Here is one way:
proc sql noprint;
select name
into :reorder
separated by ' '
from dictionary.columns
where libname="SASHELP" and
memname="CLASS"
order by name
;
quit;
proc print data=sashelp.class;
var &reorder.;
run;
Thank you art297 for quick reply..
i found another way..
proc contents data=sashelp.class out=class1(keep=name);
run;
proc sql;
select name into:names separated by '' from class1;
quit;
data final;
retain &names;
set sashelp.class;
run;
I'm sure there are additional ways. I like the one I proposed as it requires less steps then the method you found.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.