Hi Everyone,
I would like SAS to return previous working day.
Can you please help?
Thanks,
HHC
The basic function is:
prevWeekDay = intnx("WEEKDAY", myDate, -1);
Define "working day".
There really is not a universal definition for that. When I was in the US Army every day was a "working day".
If Holidays are to be excluded then which ones, and in which country (some holidays of the same name are celebrated on different calendar dates in different countries).
Hi,
I meant simple US business day or normal week day.
Thanks,
HHC
The basic function is:
prevWeekDay = intnx("WEEKDAY", myDate, -1);
Thank you so much!
HHC
@hhchenfx wrote:
Hi,
I meant simple US business day or normal week day.
Thanks,
HHC
I'll reiterate: there ain't such a thing. If you mean to exclude Federal Holidays on the observed days that's fine, say so but many organization pick and choose which to follow. The SAS Holidayname function returns the names of holidays associated with a given date. So you can test a candidate date to see if it is one of the holidays you expect to observe. If it is then use the INTNX function to get the previous day to test.
When I worked for a University they did not observe Columbus Day or Veterans day.
Many many companies work every day of a typical week and only observe a very few holidays.
A survey company I worked for that typically worked Saturdays would not work on Saturdays that coincided with certain sporting events.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.