- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Everyone,
I would like SAS to return previous working day.
Can you please help?
Thanks,
HHC
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The basic function is:
prevWeekDay = intnx("WEEKDAY", myDate, -1);
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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).
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I meant simple US business day or normal week day.
Thanks,
HHC
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The basic function is:
prevWeekDay = intnx("WEEKDAY", myDate, -1);
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much!
HHC
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@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.