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 (January 2001, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 15 Jan 2001 16:07:27 -0800
Reply-To:     "Huang, Ya" <ya.huang@AGOURON.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Huang, Ya" <ya.huang@AGOURON.COM>
Subject:      Re: Rounding Time to 15 minute intervals
Comments: To: "Abakah Nori (crm1nxa)" <crm1nxa@UPS.COM>
Content-Type: multipart/alternative;

Sorry, I guess I need to use round function like pete lund suggested, since you want 8:31:02 "round" to 8:30:00, not break down into a 15 minite interval (which would be 8:30:01-8:45:00).

-----Original Message----- From: Huang, Ya Sent: Monday, January 15, 2001 3:43 PM To: 'Abakah Nori (crm1nxa)'; SAS-L@LISTSERV.UGA.EDU Subject: RE: Rounding Time to 15 minute intervals

Nori, try this:

data xx; input tt time.; cards; 23:59:59.00 10:14:23.55 08:31:02.02 19:43:49.95 ;

data xx; set xx; t15=ceil(tt/'00:15:00't)*'00:15:00't;

options nocenter;

proc print; format tt time. t15 tod.; run;

------------------------------ The SAS System 15:34 Monday, January 15, 2001 7

Obs tt t15

1 23:59:59 00:00:00 2 10:14:23 10:15:00 3 8:31:02 08:45:00 4 19:43:49 19:45:00

HTH

Ya Huang

-----Original Message----- From: Abakah Nori (crm1nxa) [mailto:crm1nxa@UPS.COM] Sent: Monday, January 15, 2001 3:20 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Rounding Time to 15 minute intervals

I would like to break my time variable down into 15 minute intervals such that:

23:59:59.00 = 0:00 10:14:23.55 = 10:15 08:31:02.02 = 8:30 19:43:49.95 = 19:45

I can use PROC FORMAT to do this but is there any other nifty way? It's incredible the wealth of cool stuff I get on this list... Thanks a whole bunch...

Nori


[text/html]


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