Date: Tue, 29 Jan 2002 16:05:52 +0000
Reply-To: patrice michel <patricemichel@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: patrice michel <patricemichel@HOTMAIL.COM>
Subject: Re: INTNX usage (and suggestion for enhancement)
Content-Type: text/plain; charset=iso-8859-1; format=flowed
There is a probleme with this syntax.
Assume olddate = 29 mars 2002.
newdate = mdy(month(olddate)-1, day(olddate),year(olddate))
give 29 februar 2002 ==> ERROR.
You must do
INTNX ('month',olddate) ,-1) + 29, and the result is 1 march 2001.
>From: "Bruce F. Gilsen" <bruce.gilsen@FRB.GOV>
>Reply-To: "Bruce F. Gilsen" <bruce.gilsen@FRB.GOV>
>Subject: Re: INTNX usage (and suggestion for enhancement)
>Date: Tue, 29 Jan 2002 15:15:00 GMT
>There's something that's always bothered me about INTNX. By default, the
>returned date is aligned to beginning of the interval. Around 6.07, SI
>added a 4th argument to INTNX, alignment, with values BEGINNING, MIDDLE,
>and END, with BEGINNING as the default. 99.99% of the time, the alignment
>I'd want is "SAME", ie.,
>for intnx('month','25jan2002'd,-3) I'd want the SAS date
>value for October 25, 2001.
>for intnx('year','25jan2002'd,-3) I'd want the SAS date
>value for January 25, 1999.
>I realize this can be done by statements like
>olddate = '25jan2002'd;
>newdate = mdy(month(olddate)-3, day(olddate),year(olddate));
>Nonetheless, I assume that most of the time, you wouldn't want to
>change the alignment, and is "SAME" was available, it would get
>Anyone else think this addition to INTNX would be useful?
>Bruce Gilsen firstname.lastname@example.org
>speaking only for myself (and my fantasy baseball team, which finished
>2nd in 2001)
>In article <foL$eDA98bU8EwZI@crawfordsoftware.demon.co.uk>, Peter Crawford
> > Rick Bargar <Rick_D_Bargar@CHCMAIL.COM> writes
> > >Okay, color me confused (must be Friday)! What am I doing wrong here
>or how do
> > >I read my result?
> > >
> > > D = '25JAN2002'D;
> > > N = 3;
> > >
> > > BACK_3MO = INTNX('MONTH',D,-N);
> > >
> > > PUT BACK_3MO=;
> > >
> > >and my run gives me this:
> > >
> > >BACK_3MO=15249
> > Just add some formatting for .... BACK_3MO=
> > And discover 15249 is 1-Oct-2001
> > 1 data;
> > 2 D = '25JAN2002'D;
> > 3 N = 3;
> > 4
> > 5 BACK_3MO = INTNX('MONTH',D,-N);
> > 6
> > 7 PUT BACK_3MO=;
> > 8 put back_3mo= weekdate29. ;
> > 9 run;
> > BACK_3MO=15249
> > BACK_3MO=Monday, October 1, 2001
> > NOTE: The data set WORK.DATA1 has 1 observations and 3 variables.
> > NOTE: DATA statement used:
> > real time 0.94 seconds
> > --
> > Peter Crawford
MSN Photos est le moyen le plus simple de partager et imprimer vos photos :