<?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: Determination of Array Sizes and on the fly references within the code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508703#M136667</link>
    <description>&lt;P&gt;For a large economy sized hint you might want to read the documentation and specifically the differences for&lt;/P&gt;
&lt;P&gt;CALL&amp;nbsp; SYMPUT&lt;/P&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;CALL SYMPUT&lt;STRONG&gt;X&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Short: Use Call symputx in your specific case and I bet the issue goes away.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Oct 2018 14:18:37 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-10-30T14:18:37Z</dc:date>
    <item>
      <title>Determination of Array Sizes and on the fly references within the code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508560#M136591</link>
      <description>&lt;P&gt;I am running a program where I analyze text character frequency for compression (Huffman coding)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I determine the array size needed for analysis and pass that value to a macro variable. I need to set my array size based on the macro variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let the array size needed be 10. So the macro variable &lt;STRONG&gt;&amp;amp;sizeit&lt;/STRONG&gt; is now '10'. I use symput to pass this value and confirm it is resolving as expected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to do something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set treefreqs ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; retain count_1 - count_&lt;STRONG&gt;&amp;amp;sizeit&lt;/STRONG&gt; ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; array countree [*]&amp;nbsp; count_1 - count_&lt;STRONG&gt;&amp;amp;sizeit&lt;/STRONG&gt; ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am declaring the new array and setting it with&lt;EM&gt; existing&lt;/EM&gt; values from the treefreq data -- the values for &lt;STRONG&gt;count1 - count10&lt;/STRONG&gt; are already defined.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I keep failing on getting the macro variable reference to resolve as needed i.e&amp;nbsp; '&lt;STRONG&gt;retain count_1 - count_10&lt;/STRONG&gt;' and the array does not resolve &lt;STRONG&gt;count_1 - count&lt;/STRONG&gt;_&lt;STRONG&gt;&amp;amp;sizeit&lt;/STRONG&gt;&amp;nbsp; correctly either.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know the macro is "text" not numeric, but why does this fail?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried using periods to resolve the macro&amp;nbsp; i.e&amp;nbsp; count_&lt;STRONG&gt;.&amp;amp;sizeit&lt;/STRONG&gt; but that fails as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't see an easy reference to this question, though it seems to me I have dealt with it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 01:28:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508560#M136591</guid>
      <dc:creator>Kow</dc:creator>
      <dc:date>2018-10-30T01:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Determination of Array Sizes and on the fly references within the code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508562#M136593</link>
      <description>&lt;P&gt;&lt;EM&gt;So the macro variable&amp;nbsp;&lt;STRONG&gt;&amp;amp;sizeit&lt;/STRONG&gt;&amp;nbsp;is now '10'.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Do you actually have quotes in the value of the macro variable? Remove them.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 01:37:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508562#M136593</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-10-30T01:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Determination of Array Sizes and on the fly references within the code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508564#M136595</link>
      <description>&lt;P&gt;Inspect the value by adding this before the DATA step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%put *&amp;amp;sizeit*;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That will spell out any one of a number of problems.&amp;nbsp; It might be the quotes as was mentioned, but it also might be leading blanks, the easy solution to remove leading blanks being:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let sizeit = &amp;amp;sizeit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But until you see what is in the macro variable exactly, it's difficult to diagnose.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 01:49:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508564#M136595</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-10-30T01:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: Determination of Array Sizes and on the fly references within the code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508597#M136611</link>
      <description>&lt;P&gt;Ok, the quotes around the 10 were simply to indicate I knew the macro is text, not a literal numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The macro variable does resolve correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry, cutting and pasting both code and results is ridiculous with SAS University, I have tried to attach a code, log and results as a file below (failed I guess). There is a lot of stuff there, my question is limited to definition of the array size.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data size ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set treefreq end=eof ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if eof = 1 then do ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput("SIZE_NEEDED",_N_) ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc print ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; title "Size Needed is &amp;amp;size_needed" ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That works perfectly and &lt;EM&gt;&lt;STRONG&gt;&amp;amp;size_needed prints correctly as 11 (the correct value).&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;This is my question on immediately following code:&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;data two ;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set treefreq&amp;nbsp; ;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array countree {*} count_1 - count_&amp;amp;size_needed ;&amp;nbsp;&amp;nbsp; ***&amp;lt;&amp;lt;&amp;lt;this fails immediately****;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run ;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The error I get in the log is: &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: MISSING NUMERIC SUFFIX ON NUMBERED VARIABLE LIST (count_1 - count_ )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I figure because text does not resolve as numeric. Like I said I tried a couple of things -- putting in periods to get resolution but nothing worked.&amp;nbsp; I am not referencing the array correctly in some way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;How do I use a macro variable to reference an array element ?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 08:26:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508597#M136611</guid>
      <dc:creator>Kow</dc:creator>
      <dc:date>2018-10-30T08:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Determination of Array Sizes and on the fly references within the code/Log File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508605#M136615</link>
      <description>&lt;P&gt;Here is a log file of code and log messages, if it works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 09:04:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508605#M136615</guid>
      <dc:creator>Kow</dc:creator>
      <dc:date>2018-10-30T09:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Determination of Array Sizes and on the fly references within the code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508615#M136618</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/2369"&gt;@Kow&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The macro variable does resolve correctly.&lt;/P&gt;
&lt;P&gt;(...)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; title "Size Needed is &amp;amp;size_needed" ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That works perfectly and &lt;EM&gt;&lt;STRONG&gt;&amp;amp;size_needed prints correctly as 11 (the correct value).&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I assume you checked this in HTML output where multiple blanks are compressed. In the listing destination, however, the title would have looked like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Size Needed is           11&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may have noticed the numeric-to-character-conversion note in the log (from your data step):&lt;/P&gt;
&lt;PRE&gt;NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).&lt;/PRE&gt;
&lt;P&gt;CALL SYMPUT used the default format BEST12. for the conversion of _N_=11 to a character value (to be stored in macro variable SIZE_NEEDED). The result is a &lt;EM&gt;right-aligned&lt;/EM&gt; string of length 12 consisting of &lt;EM&gt;10 blanks&lt;/EM&gt; and two 1s: &lt;FONT face="courier new,courier"&gt;"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11" &lt;/FONT&gt;(without quotation marks). As a consequence, &lt;FONT face="courier new,courier"&gt;count_&amp;amp;size_needed&lt;/FONT&gt; resolved to&amp;nbsp;&lt;FONT face="courier new,courier"&gt;count_&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11&lt;/FONT&gt;, leading to the "missing numeric suffix" error for obvious reasons.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Astounding&lt;/STRONG&gt;&amp;nbsp;has already provided a solution: the %PUT statement for diagnosis -- the leading blanks would have shown after the first asterisk -- and the %LET statement as a means of removing the leading blanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An alternative solution is to use &lt;A href="https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=p1fa0ay5pzr9yun1mvqxv8ipzd4d.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#n04leriy5ohz3cn1qwx1t9msh8jk" target="_blank"&gt;CALL SYMPUTX&lt;/A&gt; in place of CALL SYMPUT. It removes the leading blanks automatically and doesn't produce the conversion note in the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 09:45:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508615#M136618</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-30T09:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Determination of Array Sizes and on the fly references within the code/Log File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508631#M136629</link>
      <description>&lt;P&gt;What &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt; said.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if you had run&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;%put *&amp;amp;sizeit*;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt; asked, you'd have seen the left padding.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try to follow the replies when you ask questions. Otherwise why bother?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 10:33:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508631#M136629</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-10-30T10:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Determination of Array Sizes and on the fly references within the code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508703#M136667</link>
      <description>&lt;P&gt;For a large economy sized hint you might want to read the documentation and specifically the differences for&lt;/P&gt;
&lt;P&gt;CALL&amp;nbsp; SYMPUT&lt;/P&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;CALL SYMPUT&lt;STRONG&gt;X&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Short: Use Call symputx in your specific case and I bet the issue goes away.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 14:18:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508703#M136667</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-30T14:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Determination of Array Sizes and on the fly references within the code/Log File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508739#M136684</link>
      <description>You haven't provided enough information to debug or replicate your issue. I'm going to make a wild guess that this part of the code is in a macro and part is not and you're running into variable scoping issues. Look at CALL SYMPUTX() and global scoping.</description>
      <pubDate>Tue, 30 Oct 2018 15:06:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508739#M136684</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-30T15:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Determination of Array Sizes and on the fly references within the code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508853#M136698</link>
      <description>&lt;P&gt;Don't push too hard on CALL SYMPUT vs CALL SYMPUTX.&amp;nbsp; Sometimes a macro variable gets created by PROC SQL, using INTO : (which would face the same issue of numeric-to-character conversion and leading blanks).&amp;nbsp; In this particular program, adding the "X" would help.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 18:05:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508853#M136698</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-10-30T18:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: Determination of Array Sizes and on the fly references within the code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508971#M136756</link>
      <description>&lt;P&gt;&lt;EM&gt;Using SYMPUTX to define the macro variable worked and eliminated the problem.&amp;nbsp; Thanks to all for the assistance. &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once I used SYMPUTX the&amp;nbsp; array statement : &amp;nbsp; ARRAY [*]&amp;nbsp; COUNT1 - COUNT&amp;amp;SIZE_NEEDED resolved and ran.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem as described above is that SYMPUT &lt;EM&gt;retains the leading blanks&lt;/EM&gt; on the macro variable and pads them into the resolved reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i.e&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET SIZE_NEEDED = 11 ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%PUT "SIZE NEEDED:" &amp;amp;SIZE_NEEDED&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;resolves in the log to : SIZE NEEDED: ' &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 11'&amp;nbsp;&amp;nbsp; with&amp;nbsp; multiple blank spaces preceding the 11.&amp;nbsp; That prevents correct resolution in later calls to the macro variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This does answer my question but further questions arise :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-I note printing the macro var in a TITLE statement WILL strip the leading blanks and the padding will not be shown. If it strips them here it may also do so in other places without explicitly noting that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;How the length of the macro variable is determined is an additional question.&lt;/EM&gt; "The length of a macro variable is determined by the text assigned to it instead of a specific length declaration. So its length varies with each value it contains."&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a002293823.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a002293823.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That doesn't appear to be the case here -- assigning a numeric to a macro var using SYMPUT results in a length of 8 bytes regardless of the text. Passing the number 8 results in the same length macro variable as 100,000. I assume this is from using SYMPUT somehow. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also don't understand why the printed value in the log shows such a large number of blank spaces, many more than 8, for the resolved reference as put to the log?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 23:08:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508971#M136756</guid>
      <dc:creator>Kow</dc:creator>
      <dc:date>2018-10-30T23:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Determination of Array Sizes and on the fly references within the code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508974#M136758</link>
      <description>&lt;P&gt;Default conversion of numerics to character (almost any time you do not explicitly state a PUT) uses 8 as the length.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Much of the output generated by procedures will trim the leading blanks:&lt;/P&gt;
&lt;PRE&gt;data example;
   x='        something';
run;
proc print;
run;&lt;/PRE&gt;
&lt;P&gt;for instance. Which why we have a STYLE option ASIS to modify that behavior in some places.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 23:32:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508974#M136758</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-30T23:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Determination of Array Sizes and on the fly references within the code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508985#M136761</link>
      <description>&lt;P&gt;1-&lt;EM&gt; I also don't understand why the printed value in the log shows such a large number of blank spaces, many more than 8, for the resolved reference as put to the log?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;The default format used when not specified is&lt;FONT face="courier new,courier"&gt;&amp;nbsp;best12.&lt;/FONT&gt; which results in a length of 12. It's a poor format to use really, but that's what we get by default. Not too sure why a length of 8 is mentioned.&lt;/P&gt;
&lt;P&gt;You can see it by using&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data T;
  call symput('a',1);
run;  
%put &amp;amp;=a*;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which results in&lt;/P&gt;
&lt;PRE&gt;A=           1*&lt;BR /&gt;  123456789012&lt;/PRE&gt;
&lt;P&gt;Length is 12 as you can see.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2- Now that SYMPUTX exists, there is no reason to use SYMPUT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3- The code above generates&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Numeric values have been converted to character values at the places given by:&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do not tolerate these messages in the LOG.&lt;/P&gt;
&lt;P&gt;If you accept them for valid data, you will miss when they highlight invalid data and this will bite you hard.&lt;/P&gt;
&lt;P&gt;Your LOG must be squeaky clean (as much as possible, &lt;A href="https://communities.sas.com/t5/SASware-Ballot-Ideas/Add-more-options-to-customise-how-messages-are-displayed-in-the/idi-p/325172" target="_self"&gt;SAS can make this hard to achieve&lt;/A&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4-&amp;nbsp;&lt;EM&gt;I note printing the macro var in a TITLE statement WILL strip the leading blanks&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Some reporting formats, such as HTML, do not show multiple spaces. If you go see the HTML source, all the spaces are here, but they are compressed for display.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 02:23:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determination-of-Array-Sizes-and-on-the-fly-references-within/m-p/508985#M136761</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-10-31T02:23:08Z</dc:date>
    </item>
  </channel>
</rss>

