How to get the month end date
Posted: 14 August 2012 09:49 PM   [ Ignore ]
Sr. Member
RankRankRankRank
Total Posts:  169
Joined  2011-09-20

A note to myself and also want to share it with everyone here

it could be tricky to get month end date for Feb (28? 29?) ....

INTNX could be used if i first set up the basedate as 1/1/fyear

basedate = mdy(1,1,fyear);
*fry is the month we want to get the end date;

month_end_date = intnx (‘month’, base_date, fyr-1, ‘E’);

smile

 Signature 

Zenghui
A humble student of business

Profile
 
 
Posted: 17 August 2012 09:27 PM   [ Ignore ]   [ # 1 ]
Newbie
Rank
Total Posts:  8
Joined  2012-08-15

More generally for any sas date value

  month_end=intnx(‘month’,mydate,0,‘end’);  ** Gets month end for MYDATE **;

Profile
 
 
Posted: 17 August 2012 10:06 PM   [ Ignore ]   [ # 2 ]
Sr. Member
RankRankRankRank
Total Posts:  169
Joined  2011-09-20

That is very cool, Thanks!
smile

 Signature 

Zenghui
A humble student of business

Profile