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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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