10-18-2017 01:43 PM
I have 3 .txt files and need create a SAS dataset with :
- a variable with datetime of the creating this files
- a variable with filename
- a variable with filesize
How can I do this ?
I have 3 files called : claims.txt, sales.txt and product.txt
I need a SAS dataset called CONTROL like this :
This informations are about when the files were created and copied in the folder
10-18-2017 02:16 PM
Look in the Base SAS Functions help information, the category of "External Files". SAS has functions that will let you retrieve all of this information, with examples in the help text.
10-18-2017 02:56 PM
And another option, which is the same as the suggestion yesterday, but here's an example.
data meta; /*Source table mentioned already*/ set sashelp.vtable; /*this limits the data sets in the list, you can remove it*/ where memname in ('AIR', 'CARS', 'SHOES', 'BASEBALL', 'CLASS', 'FISH'); /*variables your interested in keeping: data set name, created date, modificaiton date and filesize*/ KEEP MEMNAME CRDATE MODDATE FILESIZE; RUN; *Display results; Proc print data=meta; run;a