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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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