Alright..here is the final code that helped me achieve that I really appreciate all your solutions to help me derive the below code !! options obs=max; filename dd "/july/dev/adhoc/SASEG/sample.txt" ; X "cat /master/july/adhoc//SASEG/sample.txt|awk '{print $9}'> /july/dev/adhoc//newsamp.txt"; data test; infile "/july/adhoc/adhoc/newsamp.txt"; input @1 flname : $80. ; if index(flname,'pii') > 0 or index(flname,'ssn') > 0 or index(flname,'sas7bndx') >0 then delete ; run; proc print; proc sql; select count(*) into:totrecs from test; quit; %macro conts; data _null_; set test; call symput('fln'||compress(_n_),compress(flname)); run; %do i=1 %to &totrecs.; proc contents DATA="&&fln&i." noprint OUT=july&i.(keep=name); run; proc print data=july&i.; %end; %mend conts; %conts; %put _user_;
... View more