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 (April 2011, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 21 Apr 2011 14:17:09 -0500
Reply-To:     Joe Matise <snoopy369@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Joe Matise <snoopy369@GMAIL.COM>
Subject:      Re: Time informat don't work for decimal?
Comments: To: Ya Huang <ya.huang@amylin.com>
In-Reply-To:  <201104211914.p3LIrAQI015916@waikiki.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1

No. xx:yy is read in as hh:mm, not mm:ss. I see no reason SAS should be expected to use a particular format in its log...

-Joe

On Thu, Apr 21, 2011 at 2:14 PM, Ya Huang <ya.huang@amylin.com> wrote:

> Ok, > > All these numbers are from SAS log file, real time and cpu time. > If SAS formatted the time this way, shouldn't it be able to read back in? > > Why 12:23.20 is not considered a valid time format? Shouldn't it > be interpreted as 12 minutes and 23.2 seconds? > > > > On Thu, 21 Apr 2011 12:00:11 -0700, Schwarz, Barry A > <barry.a.schwarz@BOEING.COM> wrote: > > >The first is not a valid time format and the last does not mean what you > want it to (it actually means 56:34:00.00 and not the 00:00:56.34 you want) > so the answer to your question is probably no. > > > >-----Original Message----- > >From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Ya > Huang > >Sent: Thursday, April 21, 2011 11:43 AM > >To: SAS-L@LISTSERV.UGA.EDU > >Subject: Re: Time informat don't work for decimal? > > > >So, if I have a char var, with all the possible time format values: > > > > 12:23.20 > >1:23:43.12 > > 56.34 > > > >Any simple way to read in as SAS time (without having to test > >the string first)? > > > > > > > >On Thu, 21 Apr 2011 14:35:44 -0400, Ya Huang <ya.huang@AMYLIN.COM> wrote: > > > >>"but not what SAS assumes (as a makes clear)" > >> > >>So, SAS assumes that the string has to be in HH:MM:SS.ss > >>format, or if it is MM:SS.ss format, we have to use time5.? > >> > >>This one is even weird: > >> > >>6 data _null_; > >>7 a='50.5'; > >>8 b=input(a,time.); > >>9 put b=; > >>10 run; > >> > >>b=180300 > >> > >>I wonder what SAS 'Assumes' this time? > >> > >> > >>On Thu, 21 Apr 2011 13:20:38 -0500, Joe Matise <snoopy369@GMAIL.COM> > wrote: > >> > >>>I think it's an issue of "what is what"... see this: > >>>data test; > >>>x='18:25.23'; > >>>y = input(x,TIME.); > >>>z = input('00:'||x,TIME.); > >>>a = input(substr(x,1,5),TIME.); > >>>put _all_; > >>>run; > >>> > >>>y as you note does not work. Z and A both do though, _but are not the > >>>same_. > >>> > >>>So when SAS sees 18:25.25, what is it supposed to think? > >>>HH:MM.ss or MM:SS.ss ? The former is illegal... the latter is fine, but > >>not > >>>what SAS assumes (as a makes clear). > >>> > >>>-Joe > >>> > >>>On Thu, Apr 21, 2011 at 1:17 PM, Ya Huang <ya.huang@amylin.com> wrote: > >>> > >>>> Hi there, > >>>> > >>>> I was really really surprised today: > >>>> > >>>> 1 data _null_; > >>>> 2 a='18:25.23'; > >>>> 3 b=input(a,time.); > >>>> 4 put b=; > >>>> 5 run; > >>>> > >>>> NOTE: Invalid argument to function INPUT at line 3 column 3. > >>>> b=. > >>>> a=18:25.23 b=. _ERROR_=1 _N_=1 > >>>> NOTE: Mathematical operations could not be performed at the > >>>> > >>>> If I remove the decimal part ".23", it works fine. But clearly the > >>document > >>>> says decimal part is OK: > >>>> > >>>> The TIMEw. informat reads SAS time values in the following form: > >>>> > >>>> hh:mm:ss<.ss> <AM | PM> > >>>> > >>>> Something obvious I missed? > >>>> > >>>> Thanks > >>>> > >>>> Ya > >>>> >


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