|
Or, simply add 366 to date, 1996 being a leap year.
Nat Wooding
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Joe
Matise
Sent: Friday, August 20, 2010 10:25 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: How to change the YEAR value of a numeric date variable?
I would suggest the INTNX function, with the 's' flag for 'same':
data olddate;
format date newdate ddmmyy10.;
input date ddmmyy10.;
newdate=intnx('YEAR',date,1,'s');
put newdate=;
cards;
12/06/1995
;
run;
-Joe
On Fri, Aug 20, 2010 at 8:47 AM, Arthur Tabachneck
<art297@netscape.net>wrote:
> One way would be:
>
> data olddate;
> format date ddmmyy10.;
> input date ddmmyy10.;
> date=mdy(month(date),day(date),year(date)+1);
> cards;
> 12/06/1995
> ;
>
> HTH,
> Art
> ----------
> On Aug 20, 9:41 am, SAS programmer <learnsasonl...@gmail.com> wrote:
> > data olddate;
> > format date ddmmyy10.;
> > input date ddmmyy10.;
> > cards; 12/06/1995 ;
> > run;
> >
> > I want to change the year value (which is 1995) to 1996 without
> > converting the variable to character.
> > Any help is appreciated.
>
|