Grabbing the Data Creation Date


The data table creation date is sometimes necessary, say in the footnote of your stored process. Included below is a sample to retrieve this date from the file system.

/*Open the dataset*/
%let dsid=%sysfunc(open(;
data _null_;
/*grab the CRDTE function*/

ddate=%sysfunc(attrn(&dsid;,CRDTE ));
/*Format in DDMONYY*/

call symput('ddate', put(ddate, dtdate9.));
/*Close the dataset*/

%let rc=%sysfunc(close(&dsid;));

//*Sample use of the create dataset macro*/

footnote "Data Refreshed On &ddate;";
proc gchart;
vbar sales;


About Author

Angela Hall

Senior Technical Architect

Angela offers tips on using the SAS Business Intelligence solutions. She manages a team of SAS Fraud Framework implementers within the SAS Solutions On-Demand organization. Angela also has co-written two books, 'Building BI using SAS, Content Development Examples' & 'The 50 Keys to Learning SAS Stored Processes'.

Related Posts

Comments are closed.

Back to Top