From: Al on
All:

I have a variable aestdt with these values and the they are in
character format .. I want to convert them to date9. Format to
perform some days calculation .. how can it be achieved ?? I have
tried x = input(aestdt,date9.)

Aestdt

26 JAN 2009
1 FEB 2009
UN JAN 2010
UN DEC 09
11 MAR 2010

Thanks in advance
From: a on
On Mar 22, 10:52 am, Al <ali6...(a)gmail.com> wrote:
> All:
>
> I have a variable aestdt with these values and the  they are in
> character format .. I want to convert them to  date9. Format to
> perform some days calculation .. how can it be achieved ?? I have
> tried x = input(aestdt,date9.)
>
> Aestdt
>
> 26 JAN 2009
> 1 FEB 2009
> UN JAN 2010
> UN DEC 09
> 11 MAR 2010
>
> Thanks in advance

Width 9 on informat is too small. Plus I assume you want to deal with
UNknown day somehow.

480 data _null_;
481 input Aestdt & $12.;
482 date = input(Aestdt, ? date12.);
483 if _error_ then date = input(substr(aestdt,3),monyy12.);
484 _error_ = 0;
485 format date date.;
486 put (_all_)(=);
487 cards;

Aestdt=26 JAN 2009 date=26JAN09
Aestdt=1 FEB 2009 date=01FEB09
Aestdt=UN JAN 2010 date=01JAN10
Aestdt=UN DEC 09 date=01DEC09
Aestdt=11 MAR 2010 date=11MAR10