LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (November 2007, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 2 Nov 2007 10:39:52 -0400
Reply-To:   Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject:   Re: Character date to Numeric value

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


Back to: Top of message | Previous page | Main SAS-L page