<?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 using variable for subscript in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329927#M73888</link>
    <description>&lt;P&gt;That tells us nothing. Why are you trying to do this?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;VW is a variable that's created with the array reference that ends up being circular. You've assigned it a value of 1, then it pulls the first value out of the index. Like I mentioned earlier, this works purely by chance. Change the 1/2 in your array to 5/10 and it won't work anymore.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What problem are you trying to solve with this code.&lt;/P&gt;</description>
    <pubDate>Sat, 04 Feb 2017 00:07:19 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-02-04T00:07:19Z</dc:date>
    <item>
      <title>Array using variable for subscript</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329903#M73871</link>
      <description>&lt;DIV&gt;I am running into a &lt;FONT color="#FF0000"&gt;INVALID NUMERIC&lt;/FONT&gt; error when feeding an array subscript with a variable value.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I succesfully define the array:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;Array BRAND (2) VW AUDI (1 5);&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;Put BRAND(VW);&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;/* as expected I get back the numeric result 1 */&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;But if I use the same string generated by the variable in the data set, here MAKE, it&amp;nbsp;runs into an error.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;This happens even when I apply STRIP to the character variable MAKE.&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;Put BRAND(MAKE);&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I circumvent this by proceeding an if-then logic to convert MAKE into values 1 or 2.&lt;/DIV&gt;&lt;DIV&gt;Then the array accepts the variable value, this time numeric, for the subscript.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;But why SAS derails with the other alternative?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks, Arne&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 03 Feb 2017 21:19:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329903#M73871</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2017-02-03T21:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Array using variable for subscript</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329907#M73873</link>
      <description>&lt;P&gt;Indices for arrays must be numeric. Look at the results for&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#3366ff"&gt;Put BRAND(&lt;FONT color="#ff0000"&gt;"&lt;/FONT&gt;VW&lt;FONT color="#ff0000"&gt;"&lt;/FONT&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You get something similar to:&lt;/P&gt;
&lt;P&gt;NOTE: Invalid numeric data, 'VW' , at line 295 column 11.&lt;/P&gt;
&lt;P&gt;ERROR: Array subscript out of range at line 295 column 5.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your log should have had that error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW it really helps to post code and log results in a code box using the {i} icon. copying you code introduced a bunch of . when pasted into a code editor.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2017 21:25:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329907#M73873</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-02-03T21:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Array using variable for subscript</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329911#M73876</link>
      <description>&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had exactly the log you describe.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But why does it work when I use this code for the subcript:&lt;/P&gt;&lt;P&gt;PUT BRAND(VW);&lt;/P&gt;&lt;P&gt;This works!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for leaving out the copied code, but I have some compliance issues &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I write from my personal laptop and SAS is installed on my business laptop and without making crazy things from home I cannot easily copy-paste the code.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2017 21:33:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329911#M73876</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2017-02-03T21:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Array using variable for subscript</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329916#M73878</link>
      <description>&lt;P&gt;Check what type are the variables:&lt;/P&gt;
&lt;P&gt;VW is probably &lt;STRONG&gt;numeric&lt;/STRONG&gt; and its value is either 1 or 2.&lt;/P&gt;
&lt;P&gt;MAKE is probably defined as &lt;STRONG&gt;character&lt;/STRONG&gt; with values '1' or '2';&lt;/P&gt;
&lt;P&gt;When you use &lt;STRONG&gt;strip&lt;/STRONG&gt;(var) the output is a &lt;STRONG&gt;character&lt;/STRONG&gt; type.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2017 22:08:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329916#M73878</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-02-03T22:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Array using variable for subscript</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329918#M73880</link>
      <description>&lt;P&gt;It might work, but that's really just by chance for your particular example. It's not the correct method to work. Typically you can't access the variable value via an array.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to access the value of a variable look at the VVALUEX function which can work off the variable name, not an index.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2017 22:29:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329918#M73880</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-03T22:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Array using variable for subscript</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329924#M73885</link>
      <description>Thanks for sharing this function with me. Haven't tried it so far but reading the SAS page related to it, I suppose that it doesn't work for my particular case:&lt;BR /&gt;Restriction The value of the specified expression cannot denote an array reference.</description>
      <pubDate>Fri, 03 Feb 2017 23:57:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329924#M73885</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2017-02-03T23:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: Array using variable for subscript</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329925#M73886</link>
      <description>&lt;P&gt;No, your use case doesn't make sense to be honest. If the values are fixed, is there a reason you're not using a temporary array.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to solve this problem for learning, feel free, but posting what you're trying to do will help get you an optimal solution.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Feb 2017 00:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329925#M73886</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-04T00:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Array using variable for subscript</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329926#M73887</link>
      <description>Thanks for your comment. I have tried without success defining the array as $&lt;BR /&gt;Array BRAND (2) VW AUDI ("1" "2");&lt;BR /&gt;&lt;BR /&gt;Just to make clear. The variable MAKE of the data step where I declare the array is of type character and carries the values "VW" and "AUDI".&lt;BR /&gt;&lt;BR /&gt;Put BRAND (1);&lt;BR /&gt;--&amp;gt; 1 OK&lt;BR /&gt;Put BRAND (VW);&lt;BR /&gt;--&amp;gt; 1 OK&lt;BR /&gt;&lt;BR /&gt;Put STRIP(MAKE);&lt;BR /&gt;--&amp;gt; "VW" OK&lt;BR /&gt;Put BRAND(MAKE);&lt;BR /&gt;INVALID NUMERIC NOK</description>
      <pubDate>Sat, 04 Feb 2017 00:04:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329926#M73887</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2017-02-04T00:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Array using variable for subscript</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329927#M73888</link>
      <description>&lt;P&gt;That tells us nothing. Why are you trying to do this?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;VW is a variable that's created with the array reference that ends up being circular. You've assigned it a value of 1, then it pulls the first value out of the index. Like I mentioned earlier, this works purely by chance. Change the 1/2 in your array to 5/10 and it won't work anymore.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What problem are you trying to solve with this code.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Feb 2017 00:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329927#M73888</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-02-04T00:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Array using variable for subscript</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329928#M73889</link>
      <description>OK, once again connected and having accessible my code, I'll post the complete program with a description of what I am pretending to solve.</description>
      <pubDate>Sat, 04 Feb 2017 00:08:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329928#M73889</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2017-02-04T00:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: Array using variable for subscript</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329929#M73890</link>
      <description>&lt;P&gt;You reference members of an array with an integer index into the array. Not with a NAME. &amp;nbsp;If you want to reference a variable by name then just reference the variable, there is no need to use an array. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need to convert a character variable with the name of a variable into the value of the variable the most direct way is to use the VVALUEX() function, but that would return the value as a character string. &amp;nbsp;If you wanted the value converted back to a number then use INPUT() function.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;length vw audi 8 make $32 ;
array brand vw audi (50.5 25.4);
model = 'VW';
mpg = input(vvaluex(model),32.);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or you could find a method to convert the name to the index to use with the array. &amp;nbsp;For example using the WHICHC() function might work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;model = 'VW';
mpg = brand(whichc(model,'VW','AUDI'));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Try this example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  length vw audi 8 make $32 ;
  array brand vw audi (50.5 25.4);
  input make ;
  mpg1 = input(vvaluex(make),32.);
  mpg2 = brand(whichc(make,'VW','AUDI'));
  put (_all_) (=);
cards;
VW
AUDI
;;;;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 04 Feb 2017 00:20:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/329929#M73890</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-02-04T00:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Array using variable for subscript</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/330210#M74009</link>
      <description>&lt;P&gt;&lt;FONT color="#339966" face="helvetica" size="3"&gt;Thanks to all for the many&amp;nbsp;solutions that were provided. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966" face="helvetica" size="3"&gt;I should explain what I pretended with the array reference. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966" face="helvetica" size="3"&gt;I&amp;nbsp;create a macro variable&amp;nbsp;that holds&amp;nbsp;the valid&amp;nbsp;working days for 2017. In the real example it's more straightforward than&amp;nbsp;only&amp;nbsp;taking into account the weekdays. Here, for the purpose&amp;nbsp;of&amp;nbsp;my problem,&amp;nbsp;I leave it simplified like this. &amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_NULL_&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FORMAT&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; DAYS_STRING &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$10000.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; MTuWThF = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'01Jan2017'd&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;to&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'31Dec2017'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; weekday(MTuWThF) in (&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;:&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;6&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DO&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;DAYS_STRING=CATX(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;" "&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, DAYS_STRING, MTuWThF);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;OUTPUT&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;END&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;CALL&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; SYMPUTX(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"WDAYS"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, DAYS_STRING);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966" face="georgia,palatino" size="3"&gt;/* Furthermore I create a dataset with the committee agenda for each brand */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; COMMITTEES ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; MAKE $ COMMITTEE &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;date9.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ROUND $ ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; COMMITTEE &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;weekdate17.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;cards&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;VW 12APR2017 1ST&lt;/P&gt;&lt;P&gt;LCV 19APR2017 1ST&lt;/P&gt;&lt;P&gt;SKODA 24MAY2017 1ST&lt;/P&gt;&lt;P&gt;AUDI 12JUL2017 1ST&lt;/P&gt;&lt;P&gt;SEAT 14JUN2017 1ST&lt;/P&gt;&lt;P&gt;VW 30OCT2017 2ND&lt;/P&gt;&lt;P&gt;LCV 25OCT2017 2ND&lt;/P&gt;&lt;P&gt;SKODA 28NOV2017 2ND&lt;/P&gt;&lt;P&gt;AUDI 20DEC2017 2ND&lt;/P&gt;&lt;P&gt;SEAT 15NOV2017 2ND&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966" face="georgia,palatino" size="3"&gt;/* Now I want roll back the planning&amp;nbsp;for the prior tasks that lead to&amp;nbsp;each committee. Each brand has different aspects to take into account so that I need to customize the days which are necessary to lay the groundwork&amp;nbsp;for the next event. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966" face="georgia,palatino" size="3"&gt;I.e.&amp;nbsp;there has to be a time window of 5 days between&amp;nbsp;the internal&amp;nbsp;committee&amp;nbsp;and the&amp;nbsp;final committee. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966" face="georgia,palatino" size="3"&gt;As the&amp;nbsp;workload and other parameters differ from the first semester to the second, we even have&amp;nbsp;to distinguish&amp;nbsp;between 1st and 2nd semester and fix the dates&amp;nbsp;accordingly.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966" face="georgia,palatino" size="3"&gt;This makes a case for the&amp;nbsp;use of a &lt;STRONG&gt;multi-dimensional array&lt;/STRONG&gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966" face="georgia,palatino" size="3"&gt;1st dim&amp;nbsp;is the&amp;nbsp;semester,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966" face="georgia,palatino" size="3"&gt;the second for the 5 brands&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966" face="georgia,palatino" size="3"&gt;and the third for the 3 meetings to be scheduled. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966" face="georgia,palatino" size="3"&gt;As I had&amp;nbsp;mentioned before, I created a if-then workaround for getting an integer index that I can throw into the array.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966" face="georgia,palatino" size="3"&gt;The DO LOOP goes back in the calendar&amp;nbsp;until the specified amount of available&amp;nbsp;working days equals the desired number of days&amp;nbsp;between the&amp;nbsp;event and the&amp;nbsp;pre-fixed&amp;nbsp; committee. &amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966" face="georgia,palatino" size="3"&gt;-------------------------------------------------------------------------------------------------------------------------------------------&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966" face="georgia,palatino" size="3"&gt;And&amp;nbsp;Tom's nice code, which I tested successfully, would&amp;nbsp;make the program run more efficiently . &amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966" face="georgia,palatino" size="3"&gt;Allthough the program now runs like I expect it to do,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966" face="georgia,palatino" size="3"&gt;I welcome any suggestion that lets me see where I over-complicate things. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966" face="georgia,palatino" size="3"&gt;I want to learn from the experts.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966" face="georgia,palatino" size="3"&gt;For example I asked myself if I can declare the multi-dim array with a mixture of integer / intervals and names for the elements like&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ARRAY&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; CUST {&lt;FONT color="#ff0000"&gt;"1st" "2nd"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT color="#ff0000"&gt;,&lt;/FONT&gt; &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;} &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_TEMPORARY_&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;26&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;32&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;37&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;STRONG&gt;8&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;13&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;18&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;STRONG&gt;5&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;10&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;15&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;STRONG&gt;5&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;10&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;15&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;STRONG&gt;5&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;10&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;15&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;STRONG&gt;22&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;60&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;65&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;STRONG&gt;12&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;17&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;22&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;STRONG&gt;15&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;20&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;28&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;STRONG&gt;8&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;13&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;18&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;STRONG&gt;10&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;15&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;20&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966" face="georgia,palatino" size="3"&gt;*/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; SCHEDULED;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;SET&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; WORK.COMMITTEES;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FORMAT&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; INT_COMMITTEE PRE_COMMITTEE PREPARATION &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;weekdate17.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ARRAY&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ACTIVITY (&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) $ INT_COMMITTEE PRE_COMMITTEE PREPARATION;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ARRAY&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; BRAND {*} VW SKODA LCV AUDI SEAT (&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;4&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ARRAY&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; CUST {&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;} &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_TEMPORARY_&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;26&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;32&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;37&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;STRONG&gt;8&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;13&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;18&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;STRONG&gt;5&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;10&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;15&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;STRONG&gt;5&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;10&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;15&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;STRONG&gt;5&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;10&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;15&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;STRONG&gt;22&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;60&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;65&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;STRONG&gt;12&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;17&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;22&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;STRONG&gt;15&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;20&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;28&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;STRONG&gt;8&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;13&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;18&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;STRONG&gt;10&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;15&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;20&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;RETAIN&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; C &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; N &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;IF&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; STRIP(MAKE)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"VW"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;THEN&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; H1=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ELSE&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;IF&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; STRIP(MAKE)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"SKODA"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;THEN&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; H1=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ELSE&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;IF&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; STRIP(MAKE)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"LCV"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;THEN&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; H1=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ELSE&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;IF&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; STRIP(MAKE)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"AUDI"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;THEN&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; H1=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;4&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ELSE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; H1=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;IF&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; STRIP(ROUND)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"1ST"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;THEN&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; D1=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ELSE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; D1=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DO&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; I=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;TO&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; DIM(ACTIVITY);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;C=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;N=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DO&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;WHILE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (N LT CUST(D1, BRAND(H1),I));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;C+&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;IF&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (COMMITTEE-C) IN (&amp;amp;wdays) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;THEN&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; N+&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;END&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;ACTIVITY(I)=COMMITTEE - C;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;END&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;KEEP&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; MAKE COMMITTEE INT_COMMITTEE PRE_COMMITTEE PREPARATION;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 15:31:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-using-variable-for-subscript/m-p/330210#M74009</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2017-02-06T15:31:49Z</dc:date>
    </item>
  </channel>
</rss>

