How to change data values from beginning to ending?

Reply
Contributor
Posts: 20

How to change data values from beginning to ending?

I used the proc expand command to change a weekly time series to a monthly. The monthly data set has beginning of month values. However, I would like to change the dates to end of month in order to merge the data set with another one that is a monthly time series with end of month dates.

proc expand data=c2 out=c2_month from=week to=month;
  id date;
  convert c2_weekly = c2 / observed = ending;

   run;

Any help would be great.

Super Contributor
Posts: 1,636

Re: How to change data values from beginning to ending?

using intnx function:

data have;

format date mmddyy10.;

input date mmddyy10.;

cards;

02/01/2013

03/01/2013

;

data want;

set have;

end=intnx('month',date,0,'e');

format end mmddyy10.;

proc print;run;

Ask a Question
Discussion stats
  • 1 reply
  • 117 views
  • 1 like
  • 2 in conversation