@Kirito1 wrote:
I was working on SAS and I was able to get todays date with the file name and number of records with it. Unfortunately, the user wants last modified date to be attached with filename.
Kindly, help I have no Idea how to proceed. Although, I was reading and found the below link
https://support.sas.com/kb/40/934.html
I think the link might help. If someone could provide a solution.
Thanks in advance
Last modified for the file created? Or for the SAS data set?
If the SAS data set you can consult the SAS metadata. This is just one way. The Dictionary.Tables special view contains the names, types and some of the characteristics, such as number of observations, creation date and modification date. The Libname and Memname (date set name) are stored in upper case letters. The SQL INTO allows selecting the values into macro variables as about the shortest code.
data work.newjunk;
x=3;
run;
proc sql noprint;
select strip(put(nobs,best12. -L)), put(datepart(modate),date9.) into: Numobs , : Moddate
from dictionary.tables
where libname='WORK' and memname='NEWJUNK'
;
quit;
%put number of obs is: &Numobs., Modification Date is: &Moddate. ;
Use the &numobs and &Moddate in your file name.
Still think you should use the YYMMDDN8. format instead of Date9. though.