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
Do you want to use the system date or the date in the filename to determine what's the newest file? If you want to use the create of modify date, check out the foptname function to determine them. This code looks at the date in the filename. This code works without the need for X command authorization.