<?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 problem? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Array-problem/m-p/399685#M25695</link>
    <description>&lt;P&gt;Make SAS retain the values of recovery array elements between observations by giving an initial value to the array&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;array recovery{60} (60*0);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You must also define the array in your second datastep. You don't say what the final dataset is supposed to be. Now, it will contain the whole recovery array, repeated for every element that is&amp;nbsp;less than total_loss.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Sep 2017 03:07:33 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2017-09-29T03:07:33Z</dc:date>
    <item>
      <title>Array problem?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Array-problem/m-p/399676#M25694</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the explaination of my dataset. Data contains 62 variables. One is unique key as account id and 60 variables are some monthly recovery amounts. the last variable is Total Loss. I want to know all default accounts monthly basis. For this, I created one array of recoveries which is the cumulative sum of months. I am facing problem in creating this array.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;set recovery;&lt;BR /&gt;array month{60} nm_1-nm_60;&lt;BR /&gt;array recovery{60);&lt;BR /&gt;do i=1 to 60;&lt;BR /&gt;if _n_=1 then do;&lt;BR /&gt;Recovery(i)=month(i);&lt;BR /&gt;end;&lt;BR /&gt;else do;&lt;BR /&gt;Recovery(i)= Sum(month(i),Recovery(i-1));&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after this I want to check the condition in do loop&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;set recovery;&lt;/P&gt;&lt;P&gt;do i=1 to 60;&lt;/P&gt;&lt;P&gt;If Recovery(i) &amp;lt; total_loss then output(i);&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help me with the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 01:43:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Array-problem/m-p/399676#M25694</guid>
      <dc:creator>TanviG</dc:creator>
      <dc:date>2017-09-29T01:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Array problem?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Array-problem/m-p/399685#M25695</link>
      <description>&lt;P&gt;Make SAS retain the values of recovery array elements between observations by giving an initial value to the array&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;array recovery{60} (60*0);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You must also define the array in your second datastep. You don't say what the final dataset is supposed to be. Now, it will contain the whole recovery array, repeated for every element that is&amp;nbsp;less than total_loss.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 03:07:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Array-problem/m-p/399685#M25695</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-09-29T03:07:33Z</dc:date>
    </item>
  </channel>
</rss>

