|
MCI,
first, week.2 interval won't give you the first Wedn of the specified month.
By default, Sunday will be the strating point. so Week.4 will return the
Wednesday.
Here is a working sample:
data _null_;
date='Mar99';
current_date=input('01'||date,date9.);
wed =
INTNX( 'week.4',current_date,2 );
put wed date9.;
run;
you can put the date conversion statement into the INTNX function.
HTH
Yu
On 12/7/06, MCI <330006@gmail.com> wrote:
>
> Hi guys, just can't figure this out:
>
> Suppose I have 100 rows of data, rows are such as:
> "MAR99", "MAR02", "DEC03", etc.
>
> How to convert for example, "MAR99" to the first wednesday
> in March 1999, which is, "1999-03-03"?
>
> I think the following code can give the first wednesday of the same
> month as current_date, which could be any day in March 1999, but
> how do I convert "MAR99" to current_date?
>
> wed = INTNX( 'week.2', intnx('month', current_date, 0) - 1, 3)
>
> Thanks a lot, appreciate it!
>
|