Hi All,
I'm testing my SAS code on different run dates by using date override and it's working fine.
But I see SYSDAY Automatic Variable resolves to current day.
Any possibility to override this automatic variable ?
Example - I'm running the job using date override as of 2018-09-03 , so SYSDAY should resolve to Monday.
Thanks in advance for the help.
You are going to have to provide how you are " using date override " as I that isn't a concept I have run into with SAS previously.
Also show how you are attempting to use SYSDAY. You cannot change the value of the automatic system variables. You would likely have to create your own variable using your "override" and use that instead if you need a different value.
1. SYSDAY is an automatic variable. As its name implies, its contents is set by SAS. You cannot set it and its value is set once and for all.
2. SYSDAY is not today's day, it is the day when the SAS session was started.
3. What do you call "date override"? I suspect it deals with your own process logic, and in any case it will not alter automatic macro variables.
You don't really want to change automatic macro variables, a user will assume it follows the documentation and it can cause issues that are very hard to debug down the road.
You can easily create your own macro variables and use as needed.
I do believe there's a system option that will set SYSDAY to either session start or current day.
Maxim 4: Try It.
Run this code:
%let sysday=XXX;
and the answer is obvious.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.