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 (December 2005, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 1 Dec 2005 12:08:04 -0500
Reply-To:     Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Subject:      Re: Any New Date Time Informats that will handle this -
              '10/16/2005 3:55:14 PM'

On Thu, 1 Dec 2005 11:47:10 -0500, Charles Patridge <charles_s_patridge@PRODIGY.NET> wrote:

>Does anyone know of any new datetime informats in Version 9 that will >handle this format of datetime input??? > >'10/16/2005 3:55:14 PM' - where there is AM or PM at the end of a field > >Thanks, > >Just checking before I have to create my own conversion format. > >Charles Patridge >chuck at fullcapture dot com

nearly! The ANYDTDTM. informat reads it, but ignores the PM. AM is assumed always.

43 data a; 44 x=input('10/16/2005 3:55:14 AM' ,ANYDTDTM.); 45 y=input('10/16/2005 3:55:14 PM' ,ANYDTDTM.); 46 put x datetime22.; 47 put y datetime22.; 48 run;

16OCT2005:03:55:14 16OCT2005:03:55:14

Maybe you can get the trailing string with scan(xxx,-1," ") and add 12*60*60 if it is "PM"?


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