Date: Mon, 28 Feb 2011 17:57:48 -0500
Reply-To: Arthur Tabachneck <art297@ROGERS.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Arthur Tabachneck <art297@ROGERS.COM>
Subject: Re: Working with time data in SAS XXXX
Dan,
Are they currently character or numeric?
Art
-------
On Mon, 28 Feb 2011 17:48:33 -0500, Dan Abner <dan.abner99@GMAIL.COM> wrote:
>Hello all,
>
>I have a field of 24 hr. unformat times (see below, notice that they have
>varying lengths (varying between 1 and 4 digits)). Can anyone suggest the
>easiest way to 1) convert these to SAS time values, and 2) create a new
>variable extracting just the hr part of the time (always rounding down is
>sufficient).
>
>Thank you!
>
>Dan
>
>
> obs ID TIME
> 1 C100014 1205
> 2 C100018 1214
> 3 C100018 1439
> 4 C100022 1222
> 5 C100025 1108
> 6 C100025 1242
> 7 C100026 1847
> 8 C100027 1233
> 9 C100027 2025
> 10 C100029 1845
> 11 C100030 422
> 12 C100030 302
> 13 C100031 1954
> 14 C100031 1215
> 15 C100032 2056
> 16 C100033 1348
> 17 C100034 1238
> 18 C100034 534
> 19 C100041 308
> 20 C100042 1255
> 21 C100042 1939
> 22 C100044 1302
> 23 C100046 1308
> 24 C100050 1505
> 25 C100050 1503
> 26 C100057 1343
> 27 C100059 209
> 28 C100059 1544
> 29 C100059 1104
> 30 C100060 1335
> 31 C100061 3
> 32 C100065 2122
> 33 C100066 1407
> 34 C100072 1420
> 35 C100074 1425
|