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