<?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 Calling Macro Variable to be used as part of Array Statement in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Calling-Macro-Variable-to-be-used-as-part-of-Array-Statement/m-p/21767#M4671</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; That could have been it.&amp;nbsp; I did use PROC SQL to generate the bins_needed variable.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Oct 2011 15:58:21 GMT</pubDate>
    <dc:creator>AvocadoRivalry</dc:creator>
    <dc:date>2011-10-03T15:58:21Z</dc:date>
    <item>
      <title>Calling Macro Variable to be used as part of Array Statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calling-Macro-Variable-to-be-used-as-part-of-Array-Statement/m-p/21759#M4663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the following arrays I need defined, which worked fine with the original code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;array T Ts1-Ts50;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;array Q Qs1-Qs50;&lt;/P&gt;&lt;P&gt;﻿ &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;BR /&gt;Due to some code changes, there will not always be 50 values and the number of observations is being defined as a macro variable earlier in the program.&amp;nbsp; I'm not sure if this is something specific to arrays or I'm just doing something silly when trying to call the macro variable in the name for the arrays, but hopefully this is a quick fix.&amp;nbsp; Here is the full set of code that tries to reference the macro variable to replace the Ts50 or Qs50 with the number needed:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data Default;&lt;BR /&gt;set Default;&lt;BR /&gt;if _N_ eq 1 then do; set Ts; set Quants; end;&lt;/P&gt;&lt;P&gt;array T Ts1-Ts&amp;amp;bins_needed.;&lt;BR /&gt;array Q Qs1-Qs&amp;amp;bins_needed.;&lt;/P&gt;&lt;P&gt;if quick_ratio lt Qs1 then T_QUICK = Ts1;&lt;BR /&gt;else if quick_ratio ge Qs&amp;amp;bins_needed. then T_QUICK = Ts&amp;amp;bins_needed.;&lt;BR /&gt;else do;&lt;BR /&gt;do i = 1 to (&amp;amp;bins_needed. - 1);&lt;BR /&gt;&amp;nbsp; if quick_ratio ge Q&lt;I&gt; and quick_ratio lt Q[i+1] then T_QUICK = T&lt;I&gt;;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;drop Ts1-Ts&amp;amp;bins_needed. Qs1-Qs&amp;amp;bins_needed. i;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;&lt;SPAN&gt;﻿&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;&lt;SPAN&gt;﻿&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2011 20:57:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calling-Macro-Variable-to-be-used-as-part-of-Array-Statement/m-p/21759#M4663</guid>
      <dc:creator>AvocadoRivalry</dc:creator>
      <dc:date>2011-09-30T20:57:47Z</dc:date>
    </item>
    <item>
      <title>Calling Macro Variable to be used as part of Array Statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calling-Macro-Variable-to-be-used-as-part-of-Array-Statement/m-p/21760#M4664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You didn't provide any example data, or desired result based on that data, thus one can only guess.&amp;nbsp; Hopefully, the following is at least close to what you want to accomplish:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Build some test data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data ts (drop=i);&lt;/P&gt;&lt;P&gt;&amp;nbsp; array ts(3);&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=1 to 3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ts(i)=i;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Quants (drop=i);&lt;/P&gt;&lt;P&gt;&amp;nbsp; array qs(3);&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=1 to 3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; qs(i)=i;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Default;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input quick_ratio;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;.5&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;.8&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Default;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set Default;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _N_ eq 1 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set Ts;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set Quants;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; array _T(*) Ts:;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; array _Q(*) Qs:;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain _T: _Q:;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if quick_ratio lt _Q(1) then T_QUICK = _T(1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if quick_ratio ge _Q(dim(_Q)) then T_QUICK = _T(dim(_Q));&lt;/P&gt;&lt;P&gt;&amp;nbsp; else do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i = 1 to dim(_Q)-1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if quick_ratio ge _Q&lt;I&gt; and quick_ratio lt _Q[i+1]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then T_QUICK = _T&lt;I&gt;;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; drop ts: Qs: i;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2011 22:26:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calling-Macro-Variable-to-be-used-as-part-of-Array-Statement/m-p/21760#M4664</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-09-30T22:26:30Z</dc:date>
    </item>
    <item>
      <title>Calling Macro Variable to be used as part of Array Statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calling-Macro-Variable-to-be-used-as-part-of-Array-Statement/m-p/21761#M4665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure I understand what you are asking.&amp;nbsp; I do some minor cleanup and remove an erronious %end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you wanting to determine the value of bins_needed or explicitly define it, like I have here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The proper syntax for an array statement is available here: &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000201956.htm"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000201956.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let bins_needed=15;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data default;&lt;/P&gt;&lt;P&gt; set default;&lt;/P&gt;&lt;P&gt; if _N_ eq 1 then &lt;/P&gt;&lt;P&gt;&amp;nbsp; do; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set Ts; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set Quants; &lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt; array T&lt;LI&gt; Ts1-Ts&amp;amp;bins_needed;&lt;/LI&gt;&lt;/P&gt;&lt;P&gt; array Q&lt;LI&gt; Qs1-Qs&amp;amp;bins_needed;&lt;/LI&gt;&lt;/P&gt;&lt;P&gt; if quick_ratio lt qs[1] then &lt;/P&gt;&lt;P&gt;&amp;nbsp; T_QUICK = ts[1];&lt;/P&gt;&lt;P&gt; else if quick_ratio ge Qs&amp;amp;bins_needed then &lt;/P&gt;&lt;P&gt;&amp;nbsp; T_QUICK = ts[&amp;amp;bins_needed];&lt;/P&gt;&lt;P&gt; else &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; do i = 1 to (&amp;amp;bins_needed - 1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if quick_ratio ge Q&lt;I&gt; and quick_ratio lt Q[i+1] then T_QUICK = T&lt;I&gt;;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt; drop Ts1-Ts&amp;amp;bins_needed Qs1-Qs&amp;amp;bins_needed i;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2011 22:34:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calling-Macro-Variable-to-be-used-as-part-of-Array-Statement/m-p/21761#M4665</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-09-30T22:34:06Z</dc:date>
    </item>
    <item>
      <title>Calling Macro Variable to be used as part of Array Statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calling-Macro-Variable-to-be-used-as-part-of-Array-Statement/m-p/21762#M4666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am sorry, but what is the question?&amp;nbsp; Did you get an error message? Or are you not getting the expected results?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2011 23:32:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calling-Macro-Variable-to-be-used-as-part-of-Array-Statement/m-p/21762#M4666</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-09-30T23:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Macro Variable to be used as part of Array Statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calling-Macro-Variable-to-be-used-as-part-of-Array-Statement/m-p/21763#M4667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like you are just trying to generate T_QUICK based on which bin QUICK_RATIO falls into.&lt;/P&gt;&lt;P&gt;Does not look like you even need to know how many bins there are to do that.&lt;/P&gt;&lt;P&gt;Take a look at this example. Play with the condition in the UNTIL() clause to get it to pick the right bin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data v_quants;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; input ratio @@;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;cards;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc transpose out=quants(drop=_:) prefix=Qs;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data Default;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; input quick_ratio @@;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; if _N_ eq 1 then set Quants; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; array qs qs: ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; do i=1 to dim(qs) until (quick_ratio &amp;lt; qs(i) ); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; t_quick = qs(i);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; drop qs: i ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;cards;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;0.05 0.15 0.2 1.0 1.5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc print;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; quick_&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Obs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ratio&amp;nbsp;&amp;nbsp;&amp;nbsp; t_quick&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.05&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.15&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.50&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Oct 2011 15:21:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calling-Macro-Variable-to-be-used-as-part-of-Array-Statement/m-p/21763#M4667</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-10-01T15:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Macro Variable to be used as part of Array Statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calling-Macro-Variable-to-be-used-as-part-of-Array-Statement/m-p/21764#M4668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to dynamically set the number of items in an array you can call a macro variable as follows in the array statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let periods&amp;nbsp;&amp;nbsp;&amp;nbsp; = 99;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; data xxxx.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; array personnel_expense&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {*} personnel_expense1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - personnel_expense%eval(&amp;amp;periods);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2011 15:00:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calling-Macro-Variable-to-be-used-as-part-of-Array-Statement/m-p/21764#M4668</guid>
      <dc:creator>shinnen1</dc:creator>
      <dc:date>2011-10-03T15:00:00Z</dc:date>
    </item>
    <item>
      <title>Calling Macro Variable to be used as part of Array Statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calling-Macro-Variable-to-be-used-as-part-of-Array-Statement/m-p/21765#M4669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks Shinnen1 - that was exactly what I was looking for.&amp;nbsp; I wanted to change the original code as little as possible, as it was not written by me, so the %eval function is exactly what I needed.&amp;nbsp; The problem I was having was creating a flexible value to define the last element in the array each time the macro runs and that syntax seems to work exactly as I need it to.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2011 15:20:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calling-Macro-Variable-to-be-used-as-part-of-Array-Statement/m-p/21765#M4669</guid>
      <dc:creator>AvocadoRivalry</dc:creator>
      <dc:date>2011-10-03T15:20:38Z</dc:date>
    </item>
    <item>
      <title>Calling Macro Variable to be used as part of Array Statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calling-Macro-Variable-to-be-used-as-part-of-Array-Statement/m-p/21766#M4670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If that fixes your problem then most likely the underlying cause is that the macro variable has spaces in it.&lt;/P&gt;&lt;P&gt;I usually use this simple code to fix that.&lt;/P&gt;&lt;P&gt;%let bins_needed=&amp;amp;bins_needed;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I find this usually happens when using PROC SQL to generate a count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select count(*) into :count from sashelp.class;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;%put count="&amp;amp;count";&lt;/P&gt;&lt;P&gt;%let count=&amp;amp;count;&lt;/P&gt;&lt;P&gt;%put count="&amp;amp;count";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;395&amp;nbsp; %put count="&amp;amp;count";&lt;/P&gt;&lt;P&gt;count="&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 19"&lt;/P&gt;&lt;P&gt;396&amp;nbsp; %let count=&amp;amp;count;&lt;/P&gt;&lt;P&gt;397&amp;nbsp; %put count="&amp;amp;count";&lt;/P&gt;&lt;P&gt;count="19"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2011 15:48:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calling-Macro-Variable-to-be-used-as-part-of-Array-Statement/m-p/21766#M4670</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-10-03T15:48:12Z</dc:date>
    </item>
    <item>
      <title>Calling Macro Variable to be used as part of Array Statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calling-Macro-Variable-to-be-used-as-part-of-Array-Statement/m-p/21767#M4671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; That could have been it.&amp;nbsp; I did use PROC SQL to generate the bins_needed variable.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2011 15:58:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calling-Macro-Variable-to-be-used-as-part-of-Array-Statement/m-p/21767#M4671</guid>
      <dc:creator>AvocadoRivalry</dc:creator>
      <dc:date>2011-10-03T15:58:21Z</dc:date>
    </item>
  </channel>
</rss>

