BookmarkSubscribeRSS Feed
AshokD
Obsidian | Level 7

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.

 

 

5 REPLIES 5
ballardw
Super User

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.

 

 

ChrisNZ
Tourmaline | Level 20

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.

AshokD
Obsidian | Level 7

@ChrisNZ@ballardw

 

Thanks for the input.

 

I thought , we can override the value as per our need.

 

Let me try some other way.

 

Thanks.

Reeza
Super User

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. 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1537 views
  • 0 likes
  • 5 in conversation