Hi community, my yesterday's question was a bit confusing actually it was for me too.
Now I have to a extract the latest file from a location and store it to a dataset.
suppose I have a input folder location "/sas/sasdataset/lev1/" and in that location there are multiple .txt files e.g. user20200414.txt, user20200415.txt, Userxyz.txt are present, I have to extract the latest or any of the file into a dataset. How can I do? Please if anybody a code example.
I am using below code for the latest file but the observations in variable date is null in the output of this code:
</filename users pipe "/sas/sasdata/Lev1/External_Files/Cofunds_Files/mi/"; data files; infile users truncover; input filename $100.; date = input(scan(scan(scan(filename,-1,'/'),1,'.'),3,'_'), mmddyy8.); run;
proc sort data=files; by descending date; run;
data _null_; set files; call symput('infile',filename); stop; run;/>
Now if I get the latest how can I extract it into dataset?
EDITED
... View more