BookmarkSubscribeRSS Feed
Caisha
Calcite | Level 5

Hello,

 

I am looking to use an INTNX statement in order to capture the month end date of a value, however I do not have a 'date' field that would normally be entered in the INTNX statement. What I do have is a column listing the numeric value of a month (i.e. 5 if it's May), and a 2nd column listing the numeric value of the year (i.e. 2016).

 

Any recommendations as to the fastest way to use the '5' and '2016' values to end up with a 05/31/2016 format?

 

Thanks!

 

Cait

 


sas.GIF
3 REPLIES 3
Astounding
PROC Star

Assuming your month and year values are numeric, here's a phrase you could enter wherever INTNX is expecting to see a date:

 

mdy(month, 1, year)

PGStats
Opal | Level 21

So that would be:

 

lastDayOfMonth = intnx("MONTH", mdy(month, 1, year), 0, "END");
format lastDayOfMonth mmddyy10.;
PG
Caisha
Calcite | Level 5
Hello PGStats,



Thank you for your response, it works perfectly! Thanks for helping me learn (I never used the MDY function).



Greatly appreciated!



Caisha


sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 853 views
  • 1 like
  • 3 in conversation