Hello Everyone, I want to create a programme that will run through all the datasets in a library and then use the proc freq to see the missing values in each datasets. Then export it to my local drive. I have a code and would like to modify it a bit. I want to change the red highlighted text with the green highlighted ones. so that I can run the proc freq. Now the problem is I do not know how the create a macro for each datasets (like gphe.MHPRESP1001, it should run for all the 73 datasets in the library) %let var1=gphl;
%let var2=gphe;
%macro xyz;
%do i=1 %to 2;
libname &&var&i. "/abc_&&var&i./prelock/data/raw/shared" access=readonly;
data &&var&i.._test;
set &&var&i...MHPRESP1001;
where MHDXDAT MHOCCUR MHSEV MHSPID MHTERM MHSTDAT MHONGO MHENDAT MHCAT_4 MHPRESP MHLLTCDPRESP DICT DICTVER eq '';
run;
%end;
%mend;
%xyz;
ods output nlevels= MHPRESP1001;
proc freq data= gphe.MHPRESP1001 nlevels;
tables _all_ ;
run;
ods select all; Then my plan is to export all the datasets from WORK lib to my local folder by using below libname outfile xlsx "&path.\Forecast.xlsx";
proc copy in=work out=outfile;
run;
libname outfile; Please can anyone help ?
... View more