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: Call for Content

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!

Submit your idea!

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
  • 3 replies
  • 1147 views
  • 0 likes
  • 4 in conversation