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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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