Help using Base SAS procedures

Date Change

Reply
Contributor
Posts: 74

Date Change

Hi,

I have a requirement suppose I have customer data(name,enrolldate)
I want to change the enrolldate to the end of that particular month

eg: james 12/01/2007
roby 11/10/2009
mary 02/26/2009


my desired output is:

james 12/31/2007
roby 11/30/2009
mary 02/28/2009

Please help.
Super Contributor
Super Contributor
Posts: 3,174

Re: Date Change

Using a DATA step, explore using the INTNX function in a SAS assignment statement, either to create a new variable (with the desired output FORMAT) or to change the value of an existing variable.

Scott Barry
SBBWorks, Inc.

Recommended Google advanced search argument:

change date end of month site:sas.com

intnx function site:sas.com
Contributor
Posts: 74

Re: Date Change

Thanks Scott
N/A
Posts: 0

Re: Date Change

data initial;
input name $ customer_date MMDDYY10.;
datalines;
james 12/01/2007
roby 11/10/2009
mary 02/26/2009
;
run;

data end_of_month;
set initial;
c_date=intnx('month', customer_date, 0, 'end');

proc print
data=end_of_month;
format customer_date c_date MMDDYY10.;
run;
Ask a Question
Discussion stats
  • 3 replies
  • 235 views
  • 0 likes
  • 3 in conversation