Date: Mon, 29 Dec 2008 12:52:53 -0800
Reply-To: "Nordlund, Dan (DSHS/RDA)" <NordlDJ@DSHS.WA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Nordlund, Dan (DSHS/RDA)" <NordlDJ@DSHS.WA.GOV>
Subject: Re: Time format with leading zero?
In-Reply-To: <5.1.0.14.2.20081229202141.0719c700@193.189.74.23>
Content-Type: text/plain; charset=iso-8859-1
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On
> Behalf Of John Whittington
> Sent: Monday, December 29, 2008 12:26 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Time format with leading zero?
>
> Hi folks,
>
> Am I going mad or losing my memory? I surely must have
> encountered this a
> million times before!
>
> Is there not a format (available in v8.2) which produces what
> I would have
> thought was the most commonly required format for a time variable,
> namely HH:MM with HH padded with a leading zero if necessary
> - i.e. 07:59,
> rather than 7:59 (which is what time5. appears to produce)? There are
> obviously workarounds one could implement, but I just find it hard to
> believe that such an intrinsic format does not exist!
>
> TIA.
>
> Kindest Regards,
>
> John
>
> ----------------------------------------------------------------
> Dr John Whittington, Voice: +44 (0) 1296 730225
> Mediscience Services Fax: +44 (0) 1296 738893
> Twyford Manor, Twyford, E-mail: John.W@mediscience.co.uk
> Buckingham MK18 4EL, UK
> ----------------------------------------------------------------
>
John,
In SAS 9 there is the TODw.d format which will do what you want, tod5. I don't know if it is in SAS 8.
Hope this is helpful,
Dan
Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA 98504-5204
|