Hello,
I am attempting to combine multiple data files based on a date prefix.
All of the files are located in one folder and have the date prefix of YYYYMMDD. They are excel files.
I would like to be able to give a start date, say 20160423 and have SAS return the appended files for a given amount of days....say 7, or 14, or 21.
Do you have any part of this process started?
This can't be done in EG via point and click, it requires a macro solution via code.
You'll need to write the base code and looping over the specified dates is easy enough.
IF YOUR DATA IN THE FILES IS NOT WELL STRUCTURED AND CONSISTENT THIS WILL NOT WORK.
When importing data from Excel SAS guesses at types, if your data is inconsisten then the types may not match between datasets and you'll have to deal with that issue.
Yes, I know this will require a macro....
The files are all the same format so they are structured perfectly. They were actually originally in one large files but then split out based on the day.
The reason I did not leave them all in one file is because I will be using a rolling-window to look at customers.
So you have a SAS dataset somewhere with this data? Or a single file? Honestly that would be easier and wouldn't require a macro.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.