BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi All

I need to create a new date based on todays today - so today is May, the new date should default to the 25th of June. If we are in June, the new date should default to 25th July.

I was thinking of using the :

nextMon = INTNX( 'Mon', Month(Today()), 1, 'S' );

to give me next month, but not sure how to create a value of 25Jun10

Thanks for your help.

Shelton.
3 REPLIES 3
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
You only want to specify TODAY() for 2nd argument to INTNX and use a suitable SAS DATE output format.

Scott Barry
SBBWorks, Inc.
data_null__
Jade | Level 19
You can do the same in data step if that is more appropriate for your situation.

[pre]
13 %put NextMonth25 = %sysfunc(INTNX(Mon,"25%sysfunc(Today(),monyy5.)"d,1,S),date9.);
NextMonth25 = 25JUN2010
[/pre]
barheat
Fluorite | Level 6
You were almost there with your code.
The 25th day of the next month is the first day + 24 days:

next_mon=intnx('month',today(),1) + 24;

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1869 views
  • 0 likes
  • 4 in conversation