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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.