Hello, How can I read the file date from an external file in SAS? I have a job that is already reading the fline name to load in multiple external files daily – I would like to include the date of the file in the data set I create. For example if the file was created on 3/27/2017 - I would like the code to read in 3/27/2017 so I can add it to my data set. I’m using User Written code in DI Studio to read in the file name – but I can't find how to read in the file date. Here’s the code I have so far: -------------------------------------------------------- filename DIRLIST pipe 'dir "\\filelocation\*.csv" /b '; data dirlist ; infile dirlist lrecl=200 truncover; input InFile_name $100.; run; data _null_; set dirlist end=end; count+1; call symputx('read'||put(count,7.-l),cats('filelocation',InFile_name)); call symputx('dset'||put(count,7.-l),scan(InFile_name,1,'.')); if end then call symputx('max',count); run; options mprint symbolgen; %macro readin; %do i=1 %to &max; data &&dset&i; infile "&&read&i" lrecl=1000 truncover dsd; input var1 $ var2 $ var3 $; run; %end; %mend readin; libname BICTMPOD '\\filelocation\TEMPODBC'; data BICTMPOD.work_In_File_Names; set dirlist; run;
... View more