Date: Sun, 15 Dec 1996 19:49:05 GMT
Reply-To: Anthony Ayiomamitis <ayiomami@INTERLOG.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Anthony Ayiomamitis <ayiomami@INTERLOG.COM>
Organization: InterLog Internet Services
Subject: Re: Add Calendar Year to Any Date
On Thu, 12 Dec 1996 14:16:38 -0600, Todd Weiss
The most obvious way is to use the INTNX function with 'year'
being the first parm to the function. However, be careful as this
function will "migrate" a date to the first of the week, month or
A safer bet would be to try something of the following form:
date = date + (intnx ('year', date, 1) - intnx ('year', date, 0));
The two INTNX functions in parentheses will really determine the
number of calendar days in the year of interest and when this amount
is added to your existing SAS date, you will have basically
incremented your year by one.
A second approach would be something of the form ...
date = mdy (month(year), day(date), year(date)+1);
>I am sure if I spent more time than I have at my disposal
>that I could figure this out(which I may have to do).
>Does anyone know how to get from i.e
>12/22/95 to 12/22/96
>1/1/92 to 1/1/93
>4/12/94 to 4/12/95