BookmarkSubscribeRSS Feed
ren2010
Obsidian | Level 7
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.
3 REPLIES 3
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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
ren2010
Obsidian | Level 7
Thanks Scott
deleted_user
Not applicable
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;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 976 views
  • 0 likes
  • 3 in conversation