@Tom
Thanks much for your teaching!
Using the following code as you suggested, I can read in all the .csv file and get the desired SAS dataset. The name of the SAS datasets are something like PPP035, PPP046, PPP058, etc.
proc import
datafile="&dir\%qsysfunc(dread(&did,&i))"
out=%scan(%qsysfunc(dread(&did,&i)),1,.)
dbms=csv replace
;
If I need to continue working on those SAS datasets, for the code below (the part below the comments), could you please teach me how do something like that in the original code (after successfully read in all the .csv file)? Thanks a bunch!
%macro yl;
%let aform=PPP035 PPP054 PPP065 ......;
%do i=1 %to 32;
%let form=%scan(&aform,&i);
obs=253;
proc import datafile="....\&form..csv"
dmbs=csv out=&form replace;
guessingrows=max;
datarow=4;
run;
/*for the code below, how to do something like below into the original code? */
data &form;
set &form;
keep var3 var16 count;
count=_N_;
if var16=. then delete;
run;
%end;
%mend;
%yl;
... View more