hi tom, Question 1: can we use macro functions in datastep (%scan,%sysfunc etc) Question 2: need output datasets for list of values in a varible in a dataset. could you please correct the program. *1. selecting all varible values from a varible in a table; proc sql; select distinct make into : makes separated by ' ' from sashelp.cars order by make; quit; *2.due to variable value mercedes-benz compressing and printing the values; %let makes=%sysfunc(compress(&makes,'-')); %put &makes; *3. sorting the dataset to get the different values of varibles one by one(group processing); proc sort data=sashelp.cars out=cars; by make; run; *4. want to get each distinct value from varible and making output to corresponding dataset. data &makes; set cars; by make; retain i 1; if first.make then do; output scan("&makes",i,' '); i+1; end; run;
... View more