BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I'm reading in a text file that contains a date paid field that can be any day of the month -- I want to convert that date to the end of the month date: for example

record 1, date paid 05/12/2009, mthend 05/31/2009
record 2, date paid 05/19/2009, mthend 05/31/2009
record 3, date paid 06/02/2009, mthend 06/30/2009

what is the sas procedure code that would do this for me? Thanks.
3 REPLIES 3
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Have a look at using the INTNX function for this purpose.

Scott Barry
SBBWorks, Inc.
deleted_user
Not applicable
Thanks for the hints.
rob_sas
SAS Employee
INTNX would be the correct procedure for this. This procedure can return beginning, middle and/or end of the chosen period. Sample syntax is:

data temp;
format bill_date date9.;
input bill_date mmddyy10.;
datalines;
05/12/2009
05/19/2009
06/02/2009
;

data temp2;
set temp;
format month_end date9.;

month_end = INTNX( 'month',bill_date,0,'END');

run;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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