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;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 1260 views
  • 0 likes
  • 4 in conversation