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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.