BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
abbygrover
Calcite | Level 5

I have the 3rd thursday of each month calculated, however, I need it to be the next month. when I do m+1, and the month is December, it will not show January to the following year.

 

data want (drop= y m);
format iss_date mmddyy.;

do y = year(today());
do m = month(today()) ;
iss_date=nwkdom(3,5,m,y);
output;
end;
end;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

This will give you the third Thursday of next month

 

data _null_;
   dt = intnx('week.5', intnx('month',today(),0,'e'), 3, 'b');
   format dt date9.;
   put dt;
run;

View solution in original post

2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

This will give you the third Thursday of next month

 

data _null_;
   dt = intnx('week.5', intnx('month',today(),0,'e'), 3, 'b');
   format dt date9.;
   put dt;
run;
abbygrover
Calcite | Level 5
THANK YOU!!!

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

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 2 replies
  • 747 views
  • 1 like
  • 2 in conversation