- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 12-23-2019 08:34 AM
(503 views)
I have a folder containing multiple excel files that I need to read and combine to one single SAS dataset. Is there a way I can add the modified date and time in my dataset?
For example:
if the excel workbook was saved in a folder on 12/23/19 6:00 AM, can we include " 12/23/19 6:00 AM" in the dataset?
Thanks
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Look at the fopen, foptnum, foptname and finfo functions. Or run the appropriate external command to retrieve the information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
how about this code?
%let target=c:\temp;/* specify target folder including xls files. */
filename cmd pipe "dir /s &target | findstr .xls";
data xlslist;
infile cmd;
length dtc $17;
input;
dtc=substr(_infile_,1,17);
run;