<?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: Array subscript out of range  question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168051#M300972</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Because you write "&lt;STRONG&gt;prior&lt;/STRONG&gt; 4" the one thing you might need to change on &lt;A __default_attr="2746" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/"&gt;&lt;/A&gt;'s code is the time/sequence when you assign the current value of "price" - change as done below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; background-color: rgba(255, 255, 255, 0);"&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; background-color: rgba(255, 255, 255, 0);"&gt;&lt;STRONG&gt;array p{0:3} _temporary_;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; background-color: rgba(255, 255, 255, 0);"&gt;&lt;STRONG&gt;set have; by object;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; background-color: rgba(255, 255, 255, 0);"&gt;&lt;STRONG&gt;if first.object then call missing(of p{*});&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; background-color: rgba(255, 255, 255, 0);"&gt;&lt;STRONG&gt;lowest = min(of p{*});&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; background-color: rgba(255, 255, 255, 0);"&gt;&lt;STRONG&gt;highest = max(of p{*});&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; background-color: rgba(255, 255, 255, 0);"&gt;&lt;STRONG style="font-style: inherit; background-color: rgba(255, 255, 255, 0);"&gt;&lt;STRONG&gt;p{mod(_n_,4)} = price;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; background-color: rgba(255, 255, 255, 0);"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 03 Jan 2015 09:10:25 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2015-01-03T09:10:25Z</dc:date>
    <item>
      <title>Array subscript out of range  question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168043#M300964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try to do the moving Highest and Lowest of price for each object using this array approach.&lt;/P&gt;&lt;P&gt;Somehow I got the error "Array subscript out of range ..."&lt;/P&gt;&lt;P&gt;Could you help me to correct it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HHC &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input object time price level;&lt;/P&gt;&lt;P&gt;&amp;nbsp; datalines;&lt;/P&gt;&lt;P&gt;1 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&lt;/P&gt;&lt;P&gt;1 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;1 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;/P&gt;&lt;P&gt;1 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&amp;nbsp;&amp;nbsp;&amp;nbsp; 25&lt;/P&gt;&lt;P&gt;1 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp; 63&lt;/P&gt;&lt;P&gt;2 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 29&lt;/P&gt;&lt;P&gt;2 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;2 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&lt;/P&gt;&lt;P&gt;2 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&lt;/P&gt;&lt;P&gt;2 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 18&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&lt;/P&gt;&lt;P&gt;3 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 29&lt;/P&gt;&lt;P&gt;3 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 32&lt;/P&gt;&lt;P&gt;3 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 52&lt;/P&gt;&lt;P&gt;3 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11&amp;nbsp;&amp;nbsp;&amp;nbsp; 50&lt;/P&gt;&lt;P&gt;3 100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1200&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&lt;/P&gt;&lt;P&gt;;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data want2;&lt;BR /&gt;array price2(4) _temporary_;&lt;/P&gt;&lt;P&gt;kk=0;&lt;/P&gt;&lt;P&gt;do until (last.object);&lt;BR /&gt; set have;&lt;BR /&gt; by object;&lt;BR /&gt; kk+1;&lt;BR /&gt; price2(kk)=price;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;max_record=kk;&lt;BR /&gt;nn=0;&lt;/P&gt;&lt;P&gt;do until (last.object);&lt;BR /&gt; set have;&lt;BR /&gt; by object;&lt;BR /&gt; nn+1;&lt;BR /&gt; highest=0;&lt;BR /&gt; lowest=10000;&lt;/P&gt;&lt;P&gt; do i=nn+1 to max_record;&lt;BR /&gt;&amp;nbsp; if price2(i)&amp;gt;highest then highest=price2(i);&lt;BR /&gt;&amp;nbsp; if price2(i)&amp;lt;lowest then lowest=price2(i);&lt;BR /&gt; end;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2015 00:59:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168043#M300964</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2015-01-03T00:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Array subscript out of range  question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168044#M300965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Because you set the size of your temporary array too small.&amp;nbsp; You set it to 4 and the first group has 5 records.&lt;/P&gt;&lt;P&gt;You should just set it to something really large.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; background-color: #ffffff;"&gt;array price2(1000) _temporary_;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2015 01:13:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168044#M300965</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-01-03T01:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Array subscript out of range  question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168045#M300966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Objects 1 and 2 have 5 times and you only allow for 4 in array price2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2015 01:16:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168045#M300966</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-01-03T01:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: Array subscript out of range  question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168046#M300967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;oh, what I want to do is to get the Max and Min value for the prior 4 record.&lt;/P&gt;&lt;P&gt;That's why I give the price2(4).&lt;/P&gt;&lt;P&gt;So it look like there is no way to do that moving Min/Max with array?&lt;/P&gt;&lt;P&gt;HHC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2015 01:56:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168046#M300967</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2015-01-03T01:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Array subscript out of range  question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168047#M300968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes it can be done with an array, combined with the MOD function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;array p{0:3} _temporary_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set have; by object;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if first.object then call missing(of p{*});&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;p{mod(_n_,4)} = price;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;lowest = min(of p{*});&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;highest = max(of p{*});&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2015 02:34:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168047#M300968</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-01-03T02:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: Array subscript out of range  question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168048#M300969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data want(keep=object min max);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array p(50) _temporary_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do _n_=1 by 1 until (last.object);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BY object;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p(_n_)=price;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; max=max(of p(*));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; min=min(of p(*));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2015 03:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168048#M300969</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2015-01-03T03:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Array subscript out of range  question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168049#M300970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could assign a condition when you give a price to array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do until (last.object);&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;by object;&lt;/P&gt;&lt;P&gt;kk+1;&lt;/P&gt;&lt;P&gt;if kk le 4 then price2(kk)=price;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2015 07:19:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168049#M300970</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-01-03T07:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Array subscript out of range  question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168050#M300971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You Say MOVING Maximum and Minimum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you post the required OUTPUT of the data set, HAVE?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2015 07:39:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168050#M300971</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2015-01-03T07:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Array subscript out of range  question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168051#M300972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Because you write "&lt;STRONG&gt;prior&lt;/STRONG&gt; 4" the one thing you might need to change on &lt;A __default_attr="2746" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/"&gt;&lt;/A&gt;'s code is the time/sequence when you assign the current value of "price" - change as done below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; background-color: rgba(255, 255, 255, 0);"&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; background-color: rgba(255, 255, 255, 0);"&gt;&lt;STRONG&gt;array p{0:3} _temporary_;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; background-color: rgba(255, 255, 255, 0);"&gt;&lt;STRONG&gt;set have; by object;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; background-color: rgba(255, 255, 255, 0);"&gt;&lt;STRONG&gt;if first.object then call missing(of p{*});&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; background-color: rgba(255, 255, 255, 0);"&gt;&lt;STRONG&gt;lowest = min(of p{*});&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; background-color: rgba(255, 255, 255, 0);"&gt;&lt;STRONG&gt;highest = max(of p{*});&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; background-color: rgba(255, 255, 255, 0);"&gt;&lt;STRONG style="font-style: inherit; background-color: rgba(255, 255, 255, 0);"&gt;&lt;STRONG&gt;p{mod(_n_,4)} = price;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; background-color: rgba(255, 255, 255, 0);"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2015 09:10:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168051#M300972</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-01-03T09:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: Array subscript out of range  question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168052#M300973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So the third DO loop is where you are checking for the MIN/MAX so that is what you need to modify.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; want2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; price2(&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1000&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;_temporary_&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;* Load Array for current BY GROUP ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; max_record=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;by&lt;/SPAN&gt; &lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;until&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; (last.object);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; object;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; price2(max_record)=price;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;* Loop Over Current BY GROUP ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; nn=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;by&lt;/SPAN&gt; &lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;until&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; (last.object);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; object;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;* Find min and max over current and three previous values for this by group ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; highest=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;.&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lowest=constant(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'big'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; i=max(&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,nn-&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;3&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; nn ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; highest=max(highest,price2(i));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lowest=min(lowest,price2(i));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;* Write the value out;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2015 16:26:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168052#M300973</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-01-03T16:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: Array subscript out of range  question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168053#M300974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for helping me with this problem.&lt;/P&gt;&lt;P&gt;HHC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 07:30:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-subscript-out-of-range-question/m-p/168053#M300974</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2015-01-08T07:30:46Z</dc:date>
    </item>
  </channel>
</rss>

