<?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: calculate across hourly data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/calculate-across-hourly-data/m-p/400327#M97054</link>
    <description>&lt;P&gt;If you get an error, posting the log is essential.&lt;/P&gt;</description>
    <pubDate>Mon, 02 Oct 2017 16:45:52 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-10-02T16:45:52Z</dc:date>
    <item>
      <title>calculate across hourly data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-across-hourly-data/m-p/400320#M97051</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;I am attempting to calculate &lt;/FONT&gt;"&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;11065865311" &lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;across a table of hourly data (hours 1 thru 24).&amp;nbsp; The array that I tried to setup below does not work, actually errors out.&amp;nbsp;&amp;nbsp; Is this the correct path?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; work.delete_Main(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;drop&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=i);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; work.delete_merging;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;array&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; hours {&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;24&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;} &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;4&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; H1-H24;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; i=(hour1) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;to&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; -&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;hours[i]=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;100&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; i=(hour1);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;hours[i]=hours/&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;11065865311&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2017 16:08:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-across-hourly-data/m-p/400320#M97051</guid>
      <dc:creator>tobyfarms</dc:creator>
      <dc:date>2017-10-02T16:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: calculate across hourly data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-across-hourly-data/m-p/400325#M97052</link>
      <description>&lt;P&gt;The numerator in the expression&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; hours/11065865311&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;should be generating a "error: illegal reference to the array hours" message.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to specify an index&amp;nbsp; (i.e. hours{i}, hours{3}, etc.) in the numerator.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2017 16:29:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-across-hourly-data/m-p/400325#M97052</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-10-02T16:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: calculate across hourly data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-across-hourly-data/m-p/400327#M97054</link>
      <description>&lt;P&gt;If you get an error, posting the log is essential.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2017 16:45:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-across-hourly-data/m-p/400327#M97054</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-10-02T16:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: calculate across hourly data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-across-hourly-data/m-p/400330#M97055</link>
      <description>&lt;P&gt;Agreed, thank you. the log is what &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;&amp;nbsp;mentioned.&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: Illegal reference to the array hours.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The SAS System 08:48 Monday, October 2, 2017&lt;/P&gt;&lt;P&gt;1 %_eg_hidenotesandsource;&lt;/P&gt;&lt;P&gt;5 %_eg_hidenotesandsource;&lt;/P&gt;&lt;P&gt;46&lt;/P&gt;&lt;P&gt;47&lt;/P&gt;&lt;P&gt;48&lt;/P&gt;&lt;P&gt;49 data work.delete_Main(drop=i);&lt;/P&gt;&lt;P&gt;50 /*retain State City Date Dawn Dusk Hour1 Minute1 Hour2 Minute2 ;*/&lt;/P&gt;&lt;P&gt;51 set work.delete_merging;&lt;/P&gt;&lt;P&gt;52&lt;/P&gt;&lt;P&gt;53 array hours {24} 4 H1-H24;&lt;/P&gt;&lt;P&gt;54&lt;/P&gt;&lt;P&gt;55 do i=(hour1) to 1 by -1;&lt;/P&gt;&lt;P&gt;56 hours[i]=100;&lt;/P&gt;&lt;P&gt;57 end;&lt;/P&gt;&lt;P&gt;58&lt;/P&gt;&lt;P&gt;59&lt;/P&gt;&lt;P&gt;60 do i=(hour1);&lt;/P&gt;&lt;P&gt;61 hours[i]=hours/11065865311;&lt;/P&gt;&lt;P&gt;ERROR: Illegal reference to the array hours.&lt;/P&gt;&lt;P&gt;62 end;&lt;/P&gt;&lt;P&gt;63&lt;/P&gt;&lt;P&gt;64 output;&lt;/P&gt;&lt;P&gt;65 run;&lt;/P&gt;&lt;P&gt;NOTE: Missing values were generated as a result of performing an operation on missing values.&lt;/P&gt;&lt;P&gt;Each place is given by: (Number of times) at (Line):(Column).&lt;/P&gt;&lt;P&gt;61:27&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;WARNING: The data set WORK.DELETE_MAIN may be incomplete. When this step was stopped there were 0 observations and 33 variables.&lt;/P&gt;&lt;P&gt;WARNING: Data set WORK.DELETE_MAIN was not replaced because this step was stopped.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;real time 0.01 seconds&lt;/P&gt;&lt;P&gt;cpu time 0.02 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2017 16:47:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-across-hourly-data/m-p/400330#M97055</guid>
      <dc:creator>tobyfarms</dc:creator>
      <dc:date>2017-10-02T16:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: calculate across hourly data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-across-hourly-data/m-p/400342#M97059</link>
      <description>&lt;P&gt;Yes, you can't use the whole array in an assignment, you have to use individual members.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2017 17:22:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-across-hourly-data/m-p/400342#M97059</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-10-02T17:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: calculate across hourly data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-across-hourly-data/m-p/400371#M97062</link>
      <description>&lt;P&gt;So am I changing the array script to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;array&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; hours {&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;} H1 - H24;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; i=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;to&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;hours{i}=hours/&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;11065865311&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not understanding how I the array should be modified.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2017 18:00:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-across-hourly-data/m-p/400371#M97062</guid>
      <dc:creator>tobyfarms</dc:creator>
      <dc:date>2017-10-02T18:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: calculate across hourly data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-across-hourly-data/m-p/400372#M97063</link>
      <description>&lt;P&gt;hours without an index (as you used it on the right side of the assignment) is invalid.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2017 05:08:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-across-hourly-data/m-p/400372#M97063</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-10-03T05:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: calculate across hourly data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-across-hourly-data/m-p/400456#M97084</link>
      <description>&lt;P&gt;I repeat, your problem is in the &lt;EM&gt;&lt;STRONG&gt;NUMERATOR of hours/11065865311&lt;/STRONG&gt;&lt;/EM&gt;.&amp;nbsp;&amp;nbsp; You need something like &lt;STRONG&gt;&lt;EM&gt;hours{I}/11065865311&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2017 20:41:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-across-hourly-data/m-p/400456#M97084</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-10-02T20:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: calculate across hourly data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-across-hourly-data/m-p/400559#M97117</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;&amp;nbsp;and &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;After your initial reply, I did change the numerator to show the index.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2017 12:05:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-across-hourly-data/m-p/400559#M97117</guid>
      <dc:creator>tobyfarms</dc:creator>
      <dc:date>2017-10-03T12:05:33Z</dc:date>
    </item>
  </channel>
</rss>

