I am trying to take a semi-automated code to become fully automated. Currently we have .txt files dropped daily in a folder with the naming convention FILE1_DS1_20181212_20181212.txt, sometimes this last part of the name is a range such as FILE2_DS1_20181210_20181212.txt. Currently, every morning when I run the code I change the macro variables to match the correct dates which are needed (i.e %LET FILEDTE1=20181210, %LET FILEDTE2=20181212) so the files read in correctly.
Is there a way for SAS to automatically pull those date values from the .txt file name? The date variables are later used in imports and outputs.
FYI for more information we have 100+ text files that have this naming convention which are processed daily. I'm trying to account for data drops that cover the weekend, and other reasons,such as holidays, that may cause a date range.
Thank You!
Thank You! I will give this a try and post the code if it works.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.