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 (December 2009, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 20 Dec 2009 16:20:29 +0200
Reply-To:     eric <ericen@SAS.CN>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         eric <ericen@SAS.CN>
Organization: A noiseless patient Spider
Subject:      how to find missing intervals
Comments: To: sas-l@uga.edu
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
              reply-type=original

I have a very large dataset which contains among other variables, the following data

data mydata; input year month day time; datalines; 2009 08 1 1437 2009 08 1 1459 2009 08 1 1529 2009 08 1 1548 ;

The above shows that the 1430 update came in at 1437, 1500 update came in at 1459, 1530 update came in at 1529 and 1600 update came in at 1548. Data can be within 15 minutes of the intended update time, before or after.

The goal is to find any gaps in the data and to insert dummy rows where the time variable minute portion is missing a 30min update interval

Thus this kind of data would be tagged to "mark" the missing interval and the goal is to insert dummy rown to "make up" the missing rows

2009 08 1 1801 2009 08 1 1859 2009 08 1 2012 2009 08 1 2139

In the above rows, the 1800 update came in at 1801, the update for 1830 is *missing*, the update for 1900 came in at 1859, the update for 1930 is *missing*, the update for 2000 came in at 2012, the update for 2030 is *missing*, the update for 2100 is *missing* and the update for 2130 came in at 2139


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