Date: Mon, 24 Nov 2003 14:04:18 -0500
Reply-To: "Chakravarthy, Venky" <Venky.Chakravarthy@PFIZER.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Chakravarthy, Venky" <Venky.Chakravarthy@PFIZER.COM>
Subject: Re: Four byte time informat
Content-Type: text/plain; charset="iso-8859-1"
Since you are reading in character values, I think you mean INFORMATS and
not FORMATS. I am afraid there isn't a SAS supplied informat for doing what
you want. However time values in hours and minutes have potentially a
manageable number of values to create your own informat along these lines:
data cntlin (drop = i j) ;
retain fmtname "mytime" type "I" ;
do i = 0 to 23 ;
do j = 0 to 59 ;
start = put(i,z2.)||put(j,z2.) ;
label = input(put(i,z2.)||":"||put(j,z2.),time5.) ;
proc format cntlin = cntlin ;
69 data _null_ ;
70 x = '1120' ;
71 y = input(x,mytime.) ;
72 put y= : timeampm. ;
73 run ;
From: Rob Rohrbough [mailto:Rob@ROHRBOUGH-SYSTEMS.COM]
Sent: Monday, November 24, 2003 1:12 PM
Subject: Four byte time informat
In my wildest dreams, I would like to do the following:
x = '1120';
y = input(x, hhmm4.);
put x= y=;
SAS8 does not appear to have a four-character time format to input hours and
minutes, as in "hhmm4.", above. Am I wrong? There seems to be no "HHMM"
format, and neither time4. nor time5. work on a value like "1120".
Any suggestions other than cracking the silly thing myself? (like
translating it to "11:20")
Rob Rohrbough, Consultant Rohrbough Systems Design, Inc.
SAS Certified Professional V6/V8 A SAS Alliance Affiliate
firstname.lastname@example.org 9215 Dorcas Street
(402) 343-1493 Omaha, NE 68124-2039
Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately.