|
I assume, you will not get lucky with the datetime-informat. Better use
something like:
data a;
x="2007-01-30T17:49:00";
d=dhms(input(scan(x,1,"Tt"),yymmdd10.),0,0,
input(scan(x,2,"Tt"),time8.));
put d datetime22.;
run;
Gerhard
On Fri, 2 Nov 2007 09:52:12 -0400, SAS_learner <proccontents@GMAIL.COM>
wrote:
>Hello All,
>
>I have date (ISO 8601 standard For Ex : 2007-01-30T17:49:00 ) I am trying
>to convert it to numeric date, I checked every where for an informat to
>convert it into sas Numerical date like this ;
>
>Data Dm ;
> Set Mntx3301.Dm;
>RFSDTC1 = Input( RFSTDTC , is8601dt. ) ;
>Keep Usubjid subjid siteid RFSTDTC RFENDTC RFSTDTC1 ;
>Run;
>
>This is giving me an error,
>Then I thought of cutting it and putting it way the SAS likes
>
>
>RFSDTC1
>=input(compress(put(scan(RFSDTC,2,'-'),$2.)||put(scan(RFSDTC,3,'-'),$2.)
||put(scan(RFSDTC,1,'-'),$4.)),mmddyy8.);
>
>but is there a better way than this to do this., While converting this
way I
>would be ignoring the time part right so should I need to use datetime20.
to
>change exactly for character to Numeric.
>
>thank you all for the help
|