<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Convert time interval from min to 5 min in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-time-interval-from-min-to-5-min/m-p/762153#M241265</link>
    <description>&lt;P&gt;Most likely a two-step process.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Step 1 ---&amp;gt; create a new datetime index with five minute intervals&lt;/P&gt;
&lt;P&gt;Step 2 ---&amp;gt; use the new datetime index to aggregate columns appropriately&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Questions regarding Step 1:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the five minute interval&amp;nbsp;&lt;SPAN&gt;31MAR16:00:00:00, is this supposed to contain minutes 00, 01, 02, 03, and 04 on 31MAR16? Similarly, is 31MAR16:00:05:00 supposed to contain minutes 05, 06, 07, 08, and 09 on 31MAR16, and so on? If correct, the code below creates the new datetime index. If incorrect, please explain.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data idx_create;
 set BTC;
  do i=0 to 55 by 5;
    dateidx = ifn(i&amp;lt;=minute(time_start)&amp;lt;=i+4,dhms(datepart(time_start),hour(time_start),i,0),dateidx);
  end;
 format dateidx datetime22.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With respect to Step 2, please explain what you're looking for in the following columns and use the new datetime index value&amp;nbsp;&lt;SPAN&gt;31MAR16:00:00:00 to talk through the logic for how each column should be calculated.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;High = maximum value of High column among the 5 observations in each new datetime index value&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Low = minimum&amp;nbsp;value of High column among the 5 observations in each new datetime index value&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Exchange = ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Market = ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Open = ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Close = ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Volume = ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Aug 2021 19:30:15 GMT</pubDate>
    <dc:creator>ChanceTGardener</dc:creator>
    <dc:date>2021-08-17T19:30:15Z</dc:date>
    <item>
      <title>Convert time interval from min to 5 min</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-time-interval-from-min-to-5-min/m-p/762031#M241220</link>
      <description>&lt;P&gt;I have this BTC data This is collected with a time interval of 1 min. I want to change this interval to 5 min.&amp;nbsp;&lt;/P&gt;&lt;DIV class=" dgrid-row dgrid-row-even ui-state-default dgrid-selected ui-state-active"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;31MAR16:00:00:00&lt;/TD&gt;&lt;TD&gt;BITF&lt;/TD&gt;&lt;TD&gt;BTC/USD&lt;/TD&gt;&lt;TD&gt;413.04&lt;/TD&gt;&lt;TD&gt;413.27&lt;/TD&gt;&lt;TD&gt;413.04&lt;/TD&gt;&lt;TD&gt;413.27&lt;/TD&gt;&lt;TD&gt;8.9537465&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV class=" dgrid-row dgrid-row-odd ui-state-default dgrid-selected ui-state-active"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;31MAR16:00:01:00&lt;/TD&gt;&lt;TD&gt;BITF&lt;/TD&gt;&lt;TD&gt;BTC/USD&lt;/TD&gt;&lt;TD&gt;413.27&lt;/TD&gt;&lt;TD&gt;413.27&lt;/TD&gt;&lt;TD&gt;413.27&lt;/TD&gt;&lt;TD&gt;413.27&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV class=" dgrid-row dgrid-row-even ui-state-default dgrid-selected ui-state-active"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;31MAR16:00:02:00&lt;/TD&gt;&lt;TD&gt;BITF&lt;/TD&gt;&lt;TD&gt;BTC/USD&lt;/TD&gt;&lt;TD&gt;413.27&lt;/TD&gt;&lt;TD&gt;413.27&lt;/TD&gt;&lt;TD&gt;413.27&lt;/TD&gt;&lt;TD&gt;413.27&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV class=" dgrid-row dgrid-row-odd ui-state-default dgrid-selected ui-state-active"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;31MAR16:00:03:00&lt;/TD&gt;&lt;TD&gt;BITF&lt;/TD&gt;&lt;TD&gt;BTC/USD&lt;/TD&gt;&lt;TD&gt;413.27&lt;/TD&gt;&lt;TD&gt;413.27&lt;/TD&gt;&lt;TD&gt;413.27&lt;/TD&gt;&lt;TD&gt;413.27&lt;/TD&gt;&lt;TD&gt;4.726186&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help Thank you&lt;/P&gt;&lt;/DIV&gt;&lt;DIV class=" dgrid-row dgrid-row-even ui-state-default dgrid-selected ui-state-active"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 17 Aug 2021 12:27:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-time-interval-from-min-to-5-min/m-p/762031#M241220</guid>
      <dc:creator>mitiksh</dc:creator>
      <dc:date>2021-08-17T12:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Convert time interval from min to 5 min</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-time-interval-from-min-to-5-min/m-p/762068#M241239</link>
      <description>&lt;P&gt;You need to show what the result of changing the interval will look like, especially how it affects the other variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I recommend any example include enough "start" records to create a minimum of 2 of the intervals you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best is to provide example data in the form of a data step so we don't have to ask things like which variables may be character and other properties. Then with data we can actually write code with your variables (hint hint) and such.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 14:12:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-time-interval-from-min-to-5-min/m-p/762068#M241239</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-17T14:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: Convert time interval from min to 5 min</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-time-interval-from-min-to-5-min/m-p/762082#M241246</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data WORK.BTC;
input time_start:DATETIME. exchange:$4. market:$7. open:BEST12. high:BEST12. low:BEST12. close:BEST12. volume:BEST12.;
format time_start DATETIME. open BEST12. high BEST12. low BEST12. close BEST12. volume BEST12.;
datalines;
31MAR16:00:00:00 BITF BTC/USD 413.04 413.27 413.04 413.27 8.9537465
31MAR16:00:01:00 BITF BTC/USD 413.27 413.27 413.27 413.27 0
31MAR16:00:02:00 BITF BTC/USD 413.27 413.27 413.27 413.27 0
31MAR16:00:03:00 BITF BTC/USD 413.27 413.27 413.27 413.27 4.726186
31MAR16:00:04:00 BITF BTC/USD 413.27 413.27 413.27 413.27 0
31MAR16:00:05:00 BITF BTC/USD 413.26 413.26 413.26 413.26 0.03515718
31MAR16:00:06:00 BITF BTC/USD 413.26 413.26 413.26 413.26 0
31MAR16:00:07:00 BITF BTC/USD 413.25 413.25 413.25 413.25 0.24729037
31MAR16:00:08:00 BITF BTC/USD 413.27 413.27 413.27 413.27 1.5
31MAR16:00:09:00 BITF BTC/USD 413.27 413.28 413.27 413.28 9.27629496
31MAR16:00:10:00 BITF BTC/USD 413.28 413.51 413.28 413.51 43.64005163
31MAR16:00:11:00 BITF BTC/USD 414.25 414.93 414.25 414.93 145.1566291
31MAR16:00:12:00 BITF BTC/USD 414.88 414.9 414.88 414.9 0.1309879
31MAR16:00:13:00 BITF BTC/USD 414.98 414.99 414.98 414.98 0.65589598
31MAR16:00:14:00 BITF BTC/USD 414.98 414.98 414.98 414.98 0.01226425
31MAR16:00:15:00 BITF BTC/USD 414.98 414.98 414.98 414.98 0.03889585
31MAR16:00:16:00 BITF BTC/USD 414.98 414.98 414.98 414.98 1.062
31MAR16:00:17:00 BITF BTC/USD 414.98 414.98 414.98 414.98 0.48398974
31MAR16:00:18:00 BITF BTC/USD 414.99 414.99 414.99 414.99 26.18839859
31MAR16:00:19:00 BITF BTC/USD 414.98 414.98 414.98 414.98 0.1
;&lt;/PRE&gt;&lt;P&gt;This will generate sample dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;time_start&lt;/TD&gt;&lt;TD&gt;exchange&lt;/TD&gt;&lt;TD&gt;market&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;open&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;high&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;low&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;close&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;volume&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31MAR16:00:00:00&lt;/TD&gt;&lt;TD&gt;BITF&lt;/TD&gt;&lt;TD&gt;BTC/USD&lt;/TD&gt;&lt;TD&gt;413.04&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;413.27&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;413.04&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;413.27&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;8.9537465&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31MAR16:00:05:00&lt;/TD&gt;&lt;TD&gt;BITF&lt;/TD&gt;&lt;TD&gt;BTC/USD&lt;/TD&gt;&lt;TD&gt;413.26&lt;/TD&gt;&lt;TD&gt;413.27&lt;/TD&gt;&lt;TD&gt;413.26&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;413.26&lt;/TD&gt;&lt;TD&gt;0.03515718&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31MAR16:00:010:00&lt;/TD&gt;&lt;TD&gt;BITF&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;BTC/USD&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;413.28&lt;/TD&gt;&lt;TD&gt;413.51&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;413.25&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;413.51&lt;/TD&gt;&lt;TD&gt;43.64005163&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;This should be the desired output.&amp;nbsp;&lt;/P&gt;&lt;P&gt;we can think about of&amp;nbsp;&lt;STRONG&gt;window of 5 min&lt;/STRONG&gt; and then &lt;STRONG&gt;just consider the first and the last entry in the window&lt;/STRONG&gt;. we can directly copy the open and close but for high and low we need to find the &lt;STRONG&gt;max of high column&lt;/STRONG&gt; and low as &lt;STRONG&gt;min of low column&lt;/STRONG&gt; from those 5 entries we considered. Hope this explanation is understandable. I am a beginner so please pardon.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 15:08:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-time-interval-from-min-to-5-min/m-p/762082#M241246</guid>
      <dc:creator>mitiksh</dc:creator>
      <dc:date>2021-08-17T15:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Convert time interval from min to 5 min</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-time-interval-from-min-to-5-min/m-p/762108#M241250</link>
      <description>Do you have SAS ETS licensed? You can check with proc product_status;run;&lt;BR /&gt;&lt;BR /&gt;If so, PROC EXPAND and TIMESERIES are designed to do these type of calculations quite easily. &lt;BR /&gt;Example&lt;BR /&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/etsug/etsug_timeseries_examples01.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/etsug/etsug_timeseries_examples01.htm&lt;/A&gt;&lt;BR /&gt;Full code for example:&lt;BR /&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/etsug/etsug_code_tseex01.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/etsug/etsug_code_tseex01.htm&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Aug 2021 15:54:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-time-interval-from-min-to-5-min/m-p/762108#M241250</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-08-17T15:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Convert time interval from min to 5 min</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-time-interval-from-min-to-5-min/m-p/762135#M241261</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/384571"&gt;@mitiksh&lt;/a&gt;,&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/384571"&gt;@mitiksh&lt;/a&gt;&amp;nbsp;wrote:
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;time_start&lt;/TD&gt;
&lt;TD&gt;exchange&lt;/TD&gt;
&lt;TD&gt;market&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;open&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;high&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;low&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;close&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;volume&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;31MAR16:00:00:00&lt;/TD&gt;
&lt;TD&gt;BITF&lt;/TD&gt;
&lt;TD&gt;BTC/USD&lt;/TD&gt;
&lt;TD&gt;413.04&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;413.27&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;413.04&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;413.27&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;8.9537465&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;31MAR16:00:05:00&lt;/TD&gt;
&lt;TD&gt;BITF&lt;/TD&gt;
&lt;TD&gt;BTC/USD&lt;/TD&gt;
&lt;TD&gt;413.26&lt;/TD&gt;
&lt;TD&gt;413.27&lt;/TD&gt;
&lt;TD&gt;413.26&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;413.26&lt;/TD&gt;
&lt;TD&gt;0.03515718&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;31MAR16:00:010:00&lt;/TD&gt;
&lt;TD&gt;BITF&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;BTC/USD&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;413.28&lt;/TD&gt;
&lt;TD&gt;413.51&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;413.25&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;413.51&lt;/TD&gt;
&lt;TD&gt;43.64005163&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;This should be the desired output.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;we can think about of&amp;nbsp;&lt;STRONG&gt;window of 5 min&lt;/STRONG&gt; and then &lt;STRONG&gt;just consider the first and the last entry in the window&lt;/STRONG&gt;. we can directly copy the open and close but for high and low we need to find the &lt;STRONG&gt;max of high column&lt;/STRONG&gt; and low as &lt;STRONG&gt;min of low column&lt;/STRONG&gt; from those 5 entries we considered. Hope this explanation is understandable. I am a beginner so please pardon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Wouldn't we also add the volumes that fall into a common 5-min window so that, e.g., the &lt;FONT face="courier new,courier"&gt;4.726186&lt;/FONT&gt; from &lt;FONT face="courier new,courier"&gt;31MAR16:00:03:00&lt;/FONT&gt; would be added to the 0.03515718 in your "desired output" table?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 18:00:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-time-interval-from-min-to-5-min/m-p/762135#M241261</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-08-17T18:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Convert time interval from min to 5 min</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-time-interval-from-min-to-5-min/m-p/762153#M241265</link>
      <description>&lt;P&gt;Most likely a two-step process.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Step 1 ---&amp;gt; create a new datetime index with five minute intervals&lt;/P&gt;
&lt;P&gt;Step 2 ---&amp;gt; use the new datetime index to aggregate columns appropriately&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Questions regarding Step 1:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the five minute interval&amp;nbsp;&lt;SPAN&gt;31MAR16:00:00:00, is this supposed to contain minutes 00, 01, 02, 03, and 04 on 31MAR16? Similarly, is 31MAR16:00:05:00 supposed to contain minutes 05, 06, 07, 08, and 09 on 31MAR16, and so on? If correct, the code below creates the new datetime index. If incorrect, please explain.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data idx_create;
 set BTC;
  do i=0 to 55 by 5;
    dateidx = ifn(i&amp;lt;=minute(time_start)&amp;lt;=i+4,dhms(datepart(time_start),hour(time_start),i,0),dateidx);
  end;
 format dateidx datetime22.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With respect to Step 2, please explain what you're looking for in the following columns and use the new datetime index value&amp;nbsp;&lt;SPAN&gt;31MAR16:00:00:00 to talk through the logic for how each column should be calculated.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;High = maximum value of High column among the 5 observations in each new datetime index value&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Low = minimum&amp;nbsp;value of High column among the 5 observations in each new datetime index value&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Exchange = ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Market = ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Open = ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Close = ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Volume = ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 19:30:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-time-interval-from-min-to-5-min/m-p/762153#M241265</guid>
      <dc:creator>ChanceTGardener</dc:creator>
      <dc:date>2021-08-17T19:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Convert time interval from min to 5 min</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-time-interval-from-min-to-5-min/m-p/762218#M241307</link>
      <description>&lt;P&gt;Regarding&lt;/P&gt;&lt;P&gt;Question 1:&lt;/P&gt;&lt;P&gt;Consider this Example,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;31MAR16:00:05:00, this is supposed to contain minutes 1, 2, 3, 4 and 5 on 31MAR16. Similarly&amp;nbsp;31MAR16:00:10:00, This is supposed to contain minutes 6, 7, 8, 9 and 10.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Question 2:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Considering the new Date time index, New entry would look like this&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;31MAR16:00:00:00&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;high = Max_high (31MAR15:00:56:00, 31MAR15:00:57:00, 31MAR15:00:58:00, 31MAR15:00:59:00, 31MAR16:00:00:00)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Low = Min_low (31MAR15:00:56:00, 31MAR15:00:57:00, 31MAR15:00:58:00, 31MAR15:00:59:00, 31MAR16:00:00:00)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Open = (Open Value at 31MAR15:00:56:00)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Close = (Close Value at&amp;nbsp;31MAR16:00:00:00)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Volume = sum_volume (&lt;SPAN&gt;&amp;nbsp;31MAR15:00:56:00, 31MAR15:00:57:00, 31MAR15:00:58:00, 31MAR15:00:59:00, 31MAR16:00:00:00)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;exchange and market are same for all.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 05:17:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-time-interval-from-min-to-5-min/m-p/762218#M241307</guid>
      <dc:creator>mitiksh</dc:creator>
      <dc:date>2021-08-18T05:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Convert time interval from min to 5 min</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-time-interval-from-min-to-5-min/m-p/762224#M241310</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data WANT;
  set HAVE end=LASTOBS;
  if mod(minute(TIME_START),5)=1 | _N_=1 then do;
    call missing(_HIGH,_LOW,_VOLUME);
    _OPEN=OPEN;
  end;
  _LOW =min(LOW ,_LOW );
  _HIGH=max(HIGH,_HIGH);
  _VOLUME+VOLUME;
  if mod(minute(TIME_START),5)=0 | LASTOBS then output;
  retain _: ;
  drop OPEN HIGH LOW VOLUME ;
  rename _OPEN=OPEN _HIGH=HIGH _LOW=LOW _VOLUME=VOLUME ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 06:17:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-time-interval-from-min-to-5-min/m-p/762224#M241310</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-08-18T06:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Convert time interval from min to 5 min</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-time-interval-from-min-to-5-min/m-p/762233#M241314</link>
      <description>Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;. and every other contributor for help.&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Aug 2021 07:20:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-time-interval-from-min-to-5-min/m-p/762233#M241314</guid>
      <dc:creator>mitiksh</dc:creator>
      <dc:date>2021-08-18T07:20:36Z</dc:date>
    </item>
  </channel>
</rss>

