<?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: Data Step / Arrays help needed !!! in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136101#M27579</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaap, This would be a processing using a SAS dataset. Thus a solution that uses data step components, arrays, macros etc would be an ideal solution. Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Jul 2014 20:07:11 GMT</pubDate>
    <dc:creator>P_S_</dc:creator>
    <dc:date>2014-07-24T20:07:11Z</dc:date>
    <item>
      <title>Data Step / Arrays help needed !!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136095#M27573</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 have an interesting problem that I need to solve and need some help with.&lt;/P&gt;&lt;P&gt;Let's say I have 2 account numbers (100 and 200) that spreads across several months. Account 100 goes from month 1 to 6 and account 200 goes from month 1 to 4. Each account has balance (bal) associated to it in a certain month. The dataset example is shown below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;input account $ months bal;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;100 1 870&lt;/P&gt;&lt;P&gt;100 2 1740&lt;/P&gt;&lt;P&gt;100 3 2610&lt;/P&gt;&lt;P&gt;100 4 3480&lt;/P&gt;&lt;P&gt;100 5 4350&lt;/P&gt;&lt;P&gt;100 6 5220&lt;/P&gt;&lt;P&gt;200 1 1000&lt;/P&gt;&lt;P&gt;200 2 1500&lt;/P&gt;&lt;P&gt;200 3 1700&lt;/P&gt;&lt;P&gt;200 4 1200&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="192"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" width="64"&gt;account&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none;" width="64"&gt;months&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none;" width="64"&gt;bal&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: medium none;"&gt;100&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;1&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;870&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: medium none;"&gt;100&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;2&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;1740&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: medium none;"&gt;100&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;3&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;2610&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: medium none;"&gt;100&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;4&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;3480&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: medium none;"&gt;100&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;5&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;4350&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: medium none;"&gt;100&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;6&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;5220&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: medium none;"&gt;200&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;1&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;1000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: medium none;"&gt;200&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;2&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;1500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: medium none;"&gt;200&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;3&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;1700&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: medium none;"&gt;200&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;4&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none; border-top: medium none;"&gt;1200&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now for each account and for each balance, I need to spead the 'bal' amount based on the vector below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="384"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" width="64"&gt;VECTOR&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none;" width="64"&gt;0.2&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none;" width="64"&gt;0.3&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-left: medium none;" width="64"&gt;0.1&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-left: medium none;" width="64"&gt;0.25&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-left: medium none;" width="64"&gt;0.15&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the vector sums up to 1 (100%).&lt;/P&gt;&lt;P&gt;Example: for account 100, the month 1 bal, which is 870 has to be spread out by applying the vector..so it will be 0.2*870 = 174, 0.3*870=261, 0.1*870 = 87, 0.25*870 = 217.5 and 0.15*870 = 130.5. Please note that the sum has to equal to the bal for that particular month when we break it down (174+261+87+217.5+130.5 = 870).&lt;/P&gt;&lt;P&gt;This has to be repeaded for each month and for each loan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The final dataset will look some thing like this (this is only for account 100 but would also need to do the same for account 200 in the dataset).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="640"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl69" height="20" width="64"&gt;account&lt;/TD&gt;&lt;TD class="xl70" colspan="2" style="border-left: medium none;" width="128"&gt;ORIGINAL DATA&lt;/TD&gt;&lt;TD class="xl71" colspan="7" style="border-left: medium none;" width="448"&gt;BALANCE SPREAD OUT ACCORDING THE THE VECTOR PARAMETER&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top: medium none;"&gt;100&lt;/TD&gt;&lt;TD class="xl68" style="border-left: medium none; border-top: medium none;"&gt;months&lt;/TD&gt;&lt;TD class="xl68" style="border-left: medium none; border-top: medium none;"&gt;bal&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;bal_1&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;bal_2&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;bal_3&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;bal_4&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;bal_5&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;bal_6&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;TOTAL&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top: medium none;"&gt;100&lt;/TD&gt;&lt;TD class="xl68" style="border-left: medium none; border-top: medium none;"&gt;1&lt;/TD&gt;&lt;TD class="xl68" style="border-left: medium none; border-top: medium none;"&gt;870&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;174&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;174&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top: medium none;"&gt;100&lt;/TD&gt;&lt;TD class="xl68" style="border-left: medium none; border-top: medium none;"&gt;2&lt;/TD&gt;&lt;TD class="xl68" style="border-left: medium none; border-top: medium none;"&gt;1740&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;261&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;348&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;609&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top: medium none;"&gt;100&lt;/TD&gt;&lt;TD class="xl68" style="border-left: medium none; border-top: medium none;"&gt;3&lt;/TD&gt;&lt;TD class="xl68" style="border-left: medium none; border-top: medium none;"&gt;2610&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;87&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;522&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;522&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;1131&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top: medium none;"&gt;100&lt;/TD&gt;&lt;TD class="xl68" style="border-left: medium none; border-top: medium none;"&gt;4&lt;/TD&gt;&lt;TD class="xl68" style="border-left: medium none; border-top: medium none;"&gt;3480&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;217.5&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;174&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;783&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;696&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;1870.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top: medium none;"&gt;100&lt;/TD&gt;&lt;TD class="xl68" style="border-left: medium none; border-top: medium none;"&gt;5&lt;/TD&gt;&lt;TD class="xl68" style="border-left: medium none; border-top: medium none;"&gt;4350&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;130.5&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;435&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;261&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;1044&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;870&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;2740.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl69" height="20" style="border-top: medium none;"&gt;100&lt;/TD&gt;&lt;TD class="xl68" style="border-left: medium none; border-top: medium none;"&gt;6&lt;/TD&gt;&lt;TD class="xl68" style="border-left: medium none; border-top: medium none;"&gt;5220&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;261&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;652.5&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;348&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;1305&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;1044&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;3610.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="20" style="border-top: medium none;"&gt;100&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;7&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;391.5&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;870&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;435&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;1566&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;3262.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="20" style="border-top: medium none;"&gt;100&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;8&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;522&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;1087.5&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;522&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;2131.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="20" style="border-top: medium none;"&gt;100&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;9&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;652.5&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;1305&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;1957.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="20" style="border-top: medium none;"&gt;100&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;10&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;0&lt;/TD&gt;&lt;TD class="xl67" style="border-left: medium none; border-top: medium none;"&gt;783&lt;/TD&gt;&lt;TD class="xl65" style="border-left: medium none; border-top: medium none;"&gt;783&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice that the total in 'TOTAL' column is equal to the total in 'bal' column (18270), which it should, since we are just spreading out the bal.&lt;/P&gt;&lt;P&gt;Any ideas/suggestions for solving this will be of great help. I appreciate all your inputs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 17:10:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136095#M27573</guid>
      <dc:creator>P_S_</dc:creator>
      <dc:date>2014-07-24T17:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step / Arrays help needed !!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136096#M27574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are mentioning array processing (within rows) I would think on using lag processing. &lt;BR /&gt;Are you incrementing month's? I mean counting above 12 if necessary then the number in bal-1 is the relative monthnumber. What is the maximum value?&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 18:20:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136096#M27574</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-07-24T18:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step / Arrays help needed !!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136097#M27575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have IML licensed? This looks more like a matrix operation that would work with IML best.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 18:35:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136097#M27575</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-07-24T18:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step / Arrays help needed !!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136098#M27576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaap,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes we will need to increment the month. Like for account 100, in the intial dataset, it has month 1 - 6. The month 1 balance is 870. So we spread out this balance based on index values. Please note the vector has 5 values. So we will need to spread out month1 balance over 5 months (month 1 - month 5)&lt;/P&gt;&lt;P&gt;( month 1 balance = 174&lt;/P&gt;&lt;P&gt;month 2 balance = 261&lt;/P&gt;&lt;P&gt;month 3 balance = 87&lt;/P&gt;&lt;P&gt;month 4 balance = 217.5&lt;/P&gt;&lt;P&gt;and month 5 balance = 130.5 ..all of this is captured in variable bal_1)&lt;/P&gt;&lt;P&gt;now we need to do the same thing for month 2 balance which is 1740. Spread this balance over 5 months based on vector and capture in bal_2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So for month 6 balance, which is 5220, we need to spread this out again over 5 months based on index. So that will be month 6, 7, 8, 9 and 10.&lt;/P&gt;&lt;P&gt;So, yes if needed the months has to be increased. For the prototype we can use, each month balance will be spread over 5 months (based on the vector).&lt;/P&gt;&lt;P&gt;Hope this makes sense.&lt;/P&gt;&lt;P&gt;Solution doesnt have to be array based. It could be using any other logic.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 18:38:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136098#M27576</guid>
      <dc:creator>P_S_</dc:creator>
      <dc:date>2014-07-24T18:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step / Arrays help needed !!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136099#M27577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes I have access to IML. but i have not used it before.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 18:39:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136099#M27577</guid>
      <dc:creator>P_S_</dc:creator>
      <dc:date>2014-07-24T18:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step / Arrays help needed !!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136100#M27578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="-1" data-externalid="" data-presence="null" data-userid="735476" data-username="P.S." href="https://communities.sas.com/people/P.S." id="jive-73547621607177745571186"&gt;P.S.&lt;/A&gt; your question is making sense. I see some time-series analyses where the decomposition is a model to correct for delayed effects so the signals should become more clear and trustworthy. Ballard did a proposals to go IML. Some matrix processing is also possible in PROC DS2. The datastep SAS data is also possible.&amp;nbsp; I would like to know which direction it should go. Using UE all three options are there. ETS and OR are missing that is how it is although your solution could also be in that area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you expect more data processing reporting using a SAS dataset or would it move in pure scientific using matrices without a table like sql awareness. Can you make a guess on that?&lt;/P&gt;&lt;P&gt;Your question would be nice question to give it a bite.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 19:41:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136100#M27578</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-07-24T19:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step / Arrays help needed !!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136101#M27579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaap, This would be a processing using a SAS dataset. Thus a solution that uses data step components, arrays, macros etc would be an ideal solution. Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 20:07:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136101#M27579</guid>
      <dc:creator>P_S_</dc:creator>
      <dc:date>2014-07-24T20:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step / Arrays help needed !!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136102#M27580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This method does a bit of flipin' and floppin' but otherwise it is mostly hands free.&amp;nbsp; You should be able to change VECTOR the scoring data and not have to touch the rest of the code.&amp;nbsp; Assuming you want to change the scoring data.&amp;nbsp; You can decide if it suites you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; test;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; account $ months bal;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;datalines&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffc0;"&gt;100 1 870&lt;BR /&gt;100 2 1740&lt;BR /&gt;100 3 2610&lt;BR /&gt;100 4 3480&lt;BR /&gt;100 5 4350&lt;BR /&gt;100 6 5220&lt;BR /&gt;200 1 1000&lt;BR /&gt;200 2 1500&lt;BR /&gt;200 3 1700&lt;BR /&gt;200 4 1200&lt;BR /&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; VECTOR;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; _type_ $ _name_ $ bal;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;datalines&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffc0;"&gt;SCORE&amp;nbsp; VBAL1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.2&lt;BR /&gt;SCORE&amp;nbsp; VBAL2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.3&lt;BR /&gt;SCORE&amp;nbsp; VBAL3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.1&lt;BR /&gt;SCORE&amp;nbsp; VBAL4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.25&lt;BR /&gt;SCORE&amp;nbsp; VBAL5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.15&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;;;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;print&lt;/STRONG&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;score&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=test &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;score&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=VECTOR &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=scored;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; bal;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;print&lt;/STRONG&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;transpose&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=scored &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=s2;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; account months bal;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; VBAL:;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; s2;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; s2;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; account months bal;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; first.months &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; i=months;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; i + &lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;sort&lt;/STRONG&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; account i bal;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;transpose&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=s2 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=s3(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;rename&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=(i=months) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=_name_) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;prefix&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=nbal;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; account i;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;id&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; months;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; col1;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; want;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;merge&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; test s3;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; account months;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; total = sum(of nbal:);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;print&lt;/STRONG&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; account;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;id&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; account;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; bal total;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;IMG alt="7-25-2014 6-09-14 AM.png" class="jive-image" src="https://communities.sas.com/legacyfs/online/6884_7-25-2014 6-09-14 AM.png" /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 20:19:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136102#M27580</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-07-24T20:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step / Arrays help needed !!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136103#M27581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The more manual way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data foo;&lt;/P&gt;&lt;P&gt;input account $ month bal;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;100 1 870&lt;/P&gt;&lt;P&gt;100 2 1740&lt;/P&gt;&lt;P&gt;100 3 2610&lt;/P&gt;&lt;P&gt;100 4 3480&lt;/P&gt;&lt;P&gt;100 5 4350&lt;/P&gt;&lt;P&gt;100 6 5220&lt;/P&gt;&lt;P&gt;200 1 1000&lt;/P&gt;&lt;P&gt;200 2 1500&lt;/P&gt;&lt;P&gt;200 3 1700&lt;/P&gt;&lt;P&gt;200 4 1200&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data bar;&lt;/P&gt;&lt;P&gt;array v[5]&amp;nbsp;&amp;nbsp; _temporary_ (0.2 0.3 0.1 0.25 0.15);&lt;/P&gt;&lt;P&gt;array b[6,11] _temporary_;&lt;/P&gt;&lt;P&gt;do until (last.account);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set foo;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by account;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; b[month,11]=bal;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; do _i_=1 to 5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b[month,_i_+month-1]=bal*v[_i_];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;array x[6]&amp;nbsp;&amp;nbsp; bal_1-bal_6;&lt;/P&gt;&lt;P&gt;do month=1 to 10;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; do _j_=1 to 6;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x[_j_]=b[_j_,month];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if month&amp;lt;=6 then bal=b[month,11];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; else call missing(bal);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; total=sum(of x&lt;LI&gt;);&lt;/LI&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;call missing(of b&lt;LI&gt;, of x&lt;/LI&gt;&lt;LI&gt;);&lt;/LI&gt;&lt;/P&gt;&lt;P&gt;drop _:;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="center"&gt;&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;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE cellspacing="0" class="Table"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD colspan="1"&gt;account&lt;/TD&gt;&lt;TD colspan="1"&gt;month&lt;/TD&gt;&lt;TD colspan="1"&gt;bal&lt;/TD&gt;&lt;TD colspan="1"&gt;bal_1&lt;/TD&gt;&lt;TD colspan="1"&gt;bal_2&lt;/TD&gt;&lt;TD colspan="1"&gt;bal_3&lt;/TD&gt;&lt;TD colspan="1"&gt;bal_4&lt;/TD&gt;&lt;TD colspan="1"&gt;bal_5&lt;/TD&gt;&lt;TD colspan="1"&gt;bal_6&lt;/TD&gt;&lt;TD colspan="1"&gt;total&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap"&gt;100&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 1&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 870&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;174.0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 174&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap"&gt;100&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 2&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;1740&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;261.0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;348&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 609&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap"&gt;100&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 3&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;2610&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 87.0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;522&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;522.0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;1131&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap"&gt;100&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 4&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;3480&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;217.5&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;174&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;783.0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 696&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;1870.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap"&gt;100&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 5&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;4350&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;130.5&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;435&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;261.0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;1044&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 870.0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;2740.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap"&gt;100&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 6&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;5220&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;261&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;652.5&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 348&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;1305.0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;1044&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;3610.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap"&gt;100&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 7&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;.&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;391.5&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 870&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 435.0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;1566&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;3262.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap"&gt;100&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 8&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;.&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 522&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;1087.5&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 522&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;2131.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap"&gt;100&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 9&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;.&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 652.5&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;1305&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;1957.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap"&gt;100&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;10&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;.&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 783&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 783&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap"&gt;200&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 1&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;1000&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;200.0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap"&gt;200&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 2&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;1500&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;300.0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;300&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 600&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap"&gt;200&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 3&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;1700&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;100.0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;450&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;340.0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 890&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap"&gt;200&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 4&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;1200&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;250.0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;150&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;510.0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 240&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;1150&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap"&gt;200&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 5&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;150.0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;375&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;170.0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 360&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;1055&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap"&gt;200&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 6&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;225&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;425.0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 120&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 770&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap"&gt;200&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 7&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;255.0&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 300&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 555&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap"&gt;200&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 8&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 180&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 180&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap"&gt;200&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt; 9&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap"&gt;200&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;10&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; .&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;&amp;nbsp; . &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 22:53:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136103#M27581</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2014-07-24T22:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step / Arrays help needed !!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136104#M27582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You know me, I never like to pass up an opportunity to use PROC SCORE and especially PROC TRANSPOSE.:smileymischief:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 23:13:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136104#M27582</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-07-24T23:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step / Arrays help needed !!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136105#M27583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data foo; /* test data */ &lt;BR /&gt;input account $ month bal;&lt;BR /&gt;cards;&lt;BR /&gt;100 1 870&lt;BR /&gt;100 2 1740&lt;BR /&gt;100 3 2610&lt;BR /&gt;100 4 3480&lt;BR /&gt;100 5 4350&lt;BR /&gt;100 6 5220&lt;BR /&gt;200 1 1000&lt;BR /&gt;200 2 1500&lt;BR /&gt;200 3 1700&lt;BR /&gt;200 4 1200&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Remarks:&amp;nbsp; */&lt;/P&gt;&lt;P&gt;/* 1/ the intermediate lagged results are ordered a bit different. The same values can be found looking diagonal&amp;nbsp; */&lt;/P&gt;&lt;P&gt;/* the ballg-n columns are having the meaning of a calculated value of that previous n-th period&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/P&gt;&lt;P&gt;/* 2/ instead of the dow loop approach (retaining) and full matrix all is row oriented where the lag is used getting previous values */ &lt;BR /&gt;/* 3/ coding the calculation as a routing it can be called twice or more.&amp;nbsp;&amp;nbsp;&amp;nbsp; Filling gaps in periods is possible */&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data bar; /* assumption oredered by account&amp;nbsp; month , month no stepped intervals */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; array v[5]&amp;nbsp;&amp;nbsp; _temporary_ (0.2 0.3 0.1 0.25 0.15);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; array b ballg1-ballg5 ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; set foo ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; by account;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; link calculate ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if last.account then do _i_=1 to 4;&amp;nbsp; /* roll out queues to be empty additional 5-1 writes */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bal = . ; month = month + 1 ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; link calculate ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; return;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;calculate:&amp;nbsp; /* the lag function syntax is requiring a macrotized approach */ &lt;BR /&gt;&amp;nbsp;&amp;nbsp; b[1}=bal*v[1] ; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; b[2] =lag1(bal)*v[2]; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; b[3] =lag2(bal)*v[3]; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; b[4] =lag3(bal)*v[4]; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; b[5] =lag4(bal)*v[5];&lt;BR /&gt;&amp;nbsp;&amp;nbsp; total=sum(of ballg:) ; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; output;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt; return;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2014 07:34:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136105#M27583</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-07-25T07:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step / Arrays help needed !!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136106#M27584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For the record: I'm impressed with the quality of the help you have received.&amp;nbsp; Props to &lt;A __default_attr="733023" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;, @data_null_; , &lt;A __default_attr="8872" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2014 13:29:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136106#M27584</guid>
      <dc:creator>jdmarino</dc:creator>
      <dc:date>2014-07-25T13:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step / Arrays help needed !!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136107#M27585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data foo;
input account $ month bal;
cards;
100 1 870
100 2 1740
100 3 2610
100 4 3480
100 5 4350
100 6 5220
200 1 1000
200 2 1500
200 3 1700
200 4 1200
;
run;
 
 
data bar(drop=bal i);
 set foo;
 by&amp;nbsp; account ;
 array v{5}&amp;nbsp;&amp;nbsp; _temporary_ (0.2 0.3 0.1 0.25 0.15);
 do i=1 to month-1 ;
&amp;nbsp; b=.;output;
 end;
 do i=1 to 5;
&amp;nbsp; b=bal*v{i};output;
 end;
run;
proc sql;
 select distinct catt('bar(where=(account="',account,'" and month=',month,') rename=(b=b_',month,'))') into : list separated by ' ' from foo;
quit;
data want(drop=month);
 merge &amp;amp;list ;
 by account;
 output;
 call missing(of _all_);
run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2014 14:29:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136107#M27585</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-07-25T14:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step / Arrays help needed !!!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136108#M27586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for your great help, ideas and inputs. This is a great user community.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2014 14:49:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Arrays-help-needed/m-p/136108#M27586</guid>
      <dc:creator>P_S_</dc:creator>
      <dc:date>2014-07-25T14:49:49Z</dc:date>
    </item>
  </channel>
</rss>

