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 (June 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 19 Jun 2008 08:36:07 -0700
Reply-To:     "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Subject:      Re: querying on a time field
Comments: To: wesley.greenhead@ICLPLOYALTY.COM
In-Reply-To:  A<b1dcc9e0-f674-4ac0-bb64-2b62d6d0fe15@79g2000hsk.googlegroups.com>
Content-Type: text/plain; charset="us-ascii"

Hi Wes,

Here is one way:

data sample(keep=transtime); do i = 1 to 20; transtime = put(int((24*60*60)*ranuni(0)),time5.); output; end; run;

data result; set sample; if ('08:00't le input(transtime,time5.) le '12:00't) or ('14:00't le input(transtime,time5.) le '19:00't); run;

Hope this is helpful.

Mark Terjeson Senior Programmer Analyst Investment Management & Research Russell Investments

Russell Investments Global Leaders in Multi-Manager Investing

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of wesley.greenhead@ICLPLOYALTY.COM Sent: Thursday, June 19, 2008 7:59 AM To: SAS-L@LISTSERV.UGA.EDU Subject: querying on a time field

hiya,

just wondering if anyone can help.....

Ive got a character variable 'transtime' which contains times of the day in character format i.e 18:10.

i used the following fuction to read this character format as a new variable called 'time' : newtime =input(transtime,time8.);

I need to extract time periods from this data set (i.e between 8:00 - 12:00 and 14:00 - 19:00)

This is where Im stuck....

can anyone help please?

Cheers, Wes


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