I have a folder that that has a file added to it each day as below
Z:\old\stock110813.csv Z:\old\stock120813.csv Z:\old\stock130813.csv Z:\old\stock140813.csv
- I would like to import the latest file into SAS dynamically ie. searches the folder for the latest date
- or would like sas to make a copy of the latest and change the name & location of the file
I have been searching the web for days testing little bits of code but am struggling therefore any help would be appreciated.
cheers John
If the date is predictable (ie, today's date) then you can do:
If not, then your best bet is to use a pipe with the directory listing to see the most recent filename. Something like this (directory logic depends on your server/OS/etc.)