Date: Mon, 24 Nov 2003 23:14:21 -0500
Reply-To: "L. Bertolini" <bertolini.1@OSU.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "L. Bertolini" <bertolini.1@OSU.EDU>
Organization: Ohio State University
Subject: Re: Four byte time informat
Content-Type: text/plain; charset=windows-1252; format=flowed
Rob,
You could use a picture format.
The sample below doesn't check for valid values, but
you could easily modify it to do so.
Larry
proc format;
picture timef
low-high = '99:99'
;
run;
data a;
infile cards;
input time 4.
;
put time= time= timef.;
cards;
0737
1151
1245
1859
3489
;
Rob Rohrbough wrote:
>In my wildest dreams, I would like to do the following:
>
>data _null_;
> x = '1120';
> y = input(x, hhmm4.);
> put x= y=;
>run;
>
>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")
>
>TIA,
>
>Rob
>
>
>Rob Rohrbough, Consultant Rohrbough Systems Design, Inc.
>SAS Certified Professional V6/V8 A SAS Alliance Affiliate
>rob@rohrbough-systems.com 9215 Dorcas Street
>(402) 343-1493 Omaha, NE 68124-2039
>http://www.rohrbough-systems.com
>
|