I want to save dataset names into array, then sort the dataset. I need sort over hundred datasets. so I use the do loop.
the macro code doesn't work. can someone help check ? Thanks you !!!
data mbr_cnty_freq;
input
mbr_county:$3.
var_freq
var_name:$30.
;
datalines;
001 928 mbr_county
002 790 mbr_county
003 1500 mbr_county
004 2000 mbr_county
005 29 mbr_county
0065 mbr_county
;
run;
data mbr_cty_freq;
infile datalines dsd;
input
mbr_cty:$15.
var_freq
var_name $20.
;
datalines;
Abilene,259,mbr_cty
Sanford,78,mbr_cty
Chapel Hill,100,mbr_cty
Akron,420,mbr_cty
Durham,70,mbr_cty
Alkol,5,mbr_cty
;
run;
data mbr_ELG_freq;
infile datalines dsd;
input
mbr_elg_cd: $10.
var_freq
var_name:$30.
;
datalines ;
ACN,1420,mbr_elg
MAN,60,mbr_elg
SAA,38,mbr_elg
CBD,70,mbr_elg
AAC,5,mbr_elg
;;;;
run;
%macro sorter;
array varChk{*} $30 mbr_cnty_freq mbr_cty_freq mbr_ELG_freq;
%do i=1 %to dim(varChk) by 1;
proc sort data=varChk(i);
by var_freq;
run;
%end;
%mend sorter;
Thanks !!!
... View more