Our database updates on the 8th business day of the month so I need to create some date parameters that will depend whether or not the current day falls on or before/after the 8th business day.
Just to be clear, I'm just asking for code to identify the 8th business day, not code for creating the date parameters. 🙂
I currently use SAS EG 7.13 and SAS 9.
business_day = intnx('weekday', intnx('month', today(), 0, 'b'), 8);
If you have custom intervals, which you likely do, you need to build your own custom calendar to account for the holidays and then you can use that interval instead.
You can use TODAY() to generate todays date and then DAY() to get the day of the month.
It's not quite clear what you're looking for besides that.
business_day = intnx('weekday', intnx('month', today(), 0, 'b'), 8);
If you have custom intervals, which you likely do, you need to build your own custom calendar to account for the holidays and then you can use that interval instead.
Thanks! I was kind of hoping for a way around the custom calendar thing. I tried a set of code that employed the holiday function but even that had flaws.
But thanks for the tip!
The custom calendar isn't as hard as it seems though it was intimidating the first time I tried to figure it out.
If you're in US you can use the following to make your holiday lists:
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.