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 (November 2003, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 5 Nov 2003 07:02:37 -0800
Reply-To:     Robert <deps_bear@YAHOO.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Robert <deps_bear@YAHOO.COM>
Subject:      Re: Help? Pick up the every first record in 5 minutes intervals
              every day.
Content-Type: text/plain; charset=ISO-8859-1

Non-SQL approach:

data temp; set first_obs; timea = put(rawtime,z6.); time = hms(substr(timea,1,2),substr(timea,3,2),substr(timea,5,2)); format date1 date9. time time8.; run;

proc sort;by date1 time;

data temp; retain basetime; set temp; by date1 time; if first.date1 then basetime=time; diff = floor ( ( abs( (basetime - time) / 60 ) ) / 5 ) ; format basetime time8.; run;

proc sort;by date1 time diff;

data temp; set temp; by date1 diff time ; if first.diff; keep date1 time price; run;

proc print; var date1 time price;

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