BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Anna_dlC
Obsidian | Level 7

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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. 

 

 

View solution in original post

4 REPLIES 4
Reeza
Super User

 

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.

Reeza
Super User

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. 

 

 

Anna_dlC
Obsidian | Level 7

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!

Reeza
Super User

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:

http://www.sascommunity.org/wiki/Generating_Holiday_Lists

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 2878 views
  • 2 likes
  • 2 in conversation