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;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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