<?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: Out of Range Warning in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Out-of-Range-Warning/m-p/641539#M191213</link>
    <description>&lt;P&gt;Please &lt;STRONG&gt;COPY/PASTE (!!)&lt;/STRONG&gt; the &lt;STRONG&gt;WHOLE&lt;/STRONG&gt; log. Your code as posted does not contain ANY call of the %substr() macro function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292396"&gt;@David_Billa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm not certain why I get the out of range warning after executing the code below. Am I missing something?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;  data _null_;
 if symexist("_CD") then _CD = symget("_CD");
  else _CD = '';
  if symexist("ENTITY") then ENTITY = symget("ENTITY");
  else ENTITY = '';
 le=compress(COALESCEC(_CD,ENTITY));
call symput('le',le);
*drop _:;
run;

Log:

NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds
      
WARNING: Argument 3 to macro function %SUBSTR is out of range.&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Apr 2020 07:54:58 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-04-21T07:54:58Z</dc:date>
    <item>
      <title>Out of Range Warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Out-of-Range-Warning/m-p/641531#M191208</link>
      <description>&lt;P&gt;I'm not certain why I get the out of range warning after executing the code below. Am I missing something?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;  data _null_;
 if symexist("_CD") then _CD = symget("_CD");
  else _CD = '';
  if symexist("ENTITY") then ENTITY = symget("ENTITY");
  else ENTITY = '';
 le=compress(COALESCEC(_CD,ENTITY));
call symput('le',le);
*drop _:;
run;

Log:

NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds
      
WARNING: Argument 3 to macro function %SUBSTR is out of range.&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Apr 2020 06:58:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Out-of-Range-Warning/m-p/641531#M191208</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-04-21T06:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Out of Range Warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Out-of-Range-Warning/m-p/641533#M191209</link>
      <description>&lt;P&gt;Read the documentation:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV class="xis-eDocBody"&gt;
&lt;DIV class="xis-refDictEntry"&gt;
&lt;DIV class="xis-syntax"&gt;
&lt;DIV class="xis-syntaxDescription"&gt;
&lt;DIV class="xis-requiredArgGroup"&gt;
&lt;DIV id="p1j5qnwbc0nrkfn19ozk1wi4ivv3" class="xis-argDescriptionPair"&gt;
&lt;DIV class="xis-eDocBody"&gt;
&lt;DIV class="xis-refDictEntry"&gt;
&lt;DIV class="xis-syntax"&gt;
&lt;H2 id="p01vy9fxg7f8e4n1u7hb4luw3ms5" class="xis-title"&gt;Syntax&lt;/H2&gt;
&lt;DIV class="xis-syntaxSimple"&gt;
&lt;DIV class="xis-syntaxLevel"&gt;&lt;SPAN class="xis-keyword"&gt;%SUBSTR&lt;/SPAN&gt;&lt;SPAN class="xis-argRequired"&gt;(&lt;SPAN class="xis-userSuppliedSyntaxValue"&gt;argument&lt;/SPAN&gt;, &lt;SPAN class="xis-userSuppliedSyntaxValue"&gt;position&lt;/SPAN&gt;&lt;SPAN class="xis-argOptional"&gt;&amp;lt;, &lt;SPAN class="xis-userSuppliedSyntaxValue"&gt;length&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="xis-syntaxSimple"&gt;
&lt;DIV class="xis-syntaxLevel"&gt;&lt;SPAN class="xis-keyword"&gt;%QSUBSTR&lt;/SPAN&gt;&lt;SPAN class="xis-argRequired"&gt;(&lt;SPAN class="xis-userSuppliedSyntaxValue"&gt;argument&lt;/SPAN&gt;, &lt;SPAN class="xis-userSuppliedSyntaxValue"&gt;position&lt;/SPAN&gt;&lt;SPAN class="xis-argOptional"&gt;&amp;lt;, &lt;SPAN class="xis-userSuppliedSyntaxValue"&gt;length&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="xis-syntaxDescription"&gt;
&lt;DIV class="xis-requiredArgGroup"&gt;
&lt;H3 id="p0ez47g8dmvqwrn16qnq9znaf7lw" class="xis-title"&gt;Required Arguments&lt;/H3&gt;
&lt;DIV id="n1du164mm6wxnhn1ii155mpkamx6" class="xis-argDescriptionPair"&gt;
&lt;H4 class="xis-argument"&gt;&lt;SPAN class="xis-userSuppliedValue"&gt;argument&lt;/SPAN&gt;&lt;/H4&gt;
&lt;DIV class="xis-argumentDescription"&gt;
&lt;P class="xis-paraSimpleFirst"&gt;is a character string or a &lt;A id="GTp101gr7eidfdvjn1ut2voatopduj" class="glossTerm" target="_blank"&gt;&lt;/A&gt;text expression. If &lt;SPAN class="xis-userSuppliedValue"&gt;argument&lt;/SPAN&gt; might contain a special character or mnemonic operator, listed below, use %QSUBSTR.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV id="n1t04vpqi3pw72n1826ajnpymvj3" class="xis-argDescriptionPair"&gt;
&lt;H4 class="xis-argument"&gt;&lt;SPAN class="xis-userSuppliedValue"&gt;position&lt;/SPAN&gt;&lt;/H4&gt;
&lt;DIV class="xis-argumentDescription"&gt;
&lt;P class="xis-paraSimpleFirst"&gt;is an integer or an expression (text, logical, or arithmetic) that yields an integer, which specifies the position of the first character in the substring. If &lt;SPAN class="xis-userSuppliedValue"&gt;position&lt;/SPAN&gt; is greater than the number of characters in the string, %SUBSTR and %QSUBSTR issue a warning message and return a &lt;A id="GTp0tu8m742jcq30n1pnk4ykp19lxr" class="glossTerm" target="_blank"&gt;&lt;/A&gt;null value. An automatic call to %EVAL causes &lt;SPAN class="xis-userSuppliedValue"&gt;n&lt;/SPAN&gt; to be treated as a numeric value.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV id="p1j5qnwbc0nrkfn19ozk1wi4ivv3" class="xis-argDescriptionPair"&gt;
&lt;H4 class="xis-argument"&gt;&lt;SPAN class="xis-userSuppliedValue"&gt;length&lt;/SPAN&gt;&lt;/H4&gt;
&lt;DIV class="xis-argumentDescription"&gt;
&lt;P class="xis-paraSimpleFirst"&gt;is an optional integer or an expression (text, logical, or arithmetic) that yields an integer that specifies the number of characters in the substring.&lt;FONT color="#FF0000"&gt; If &lt;SPAN class="xis-userSuppliedValue"&gt;length&lt;/SPAN&gt; is greater than the number of characters following &lt;SPAN class="xis-userSuppliedValue"&gt;position&lt;/SPAN&gt; in &lt;SPAN class="xis-userSuppliedValue"&gt;argument&lt;/SPAN&gt;, %SUBSTR and %QSUBSTR issue a warning message&lt;/FONT&gt; and return a substring containing the characters from &lt;SPAN class="xis-userSuppliedValue"&gt;position&lt;/SPAN&gt; to the end of the string. By default, %SUBSTR and %QSUBSTR produce a string containing the characters from &lt;SPAN class="xis-userSuppliedValue"&gt;position&lt;/SPAN&gt; to the end of the character string.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;All the best&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 07:06:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Out-of-Range-Warning/m-p/641533#M191209</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-04-21T07:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: Out of Range Warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Out-of-Range-Warning/m-p/641539#M191213</link>
      <description>&lt;P&gt;Please &lt;STRONG&gt;COPY/PASTE (!!)&lt;/STRONG&gt; the &lt;STRONG&gt;WHOLE&lt;/STRONG&gt; log. Your code as posted does not contain ANY call of the %substr() macro function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292396"&gt;@David_Billa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm not certain why I get the out of range warning after executing the code below. Am I missing something?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;  data _null_;
 if symexist("_CD") then _CD = symget("_CD");
  else _CD = '';
  if symexist("ENTITY") then ENTITY = symget("ENTITY");
  else ENTITY = '';
 le=compress(COALESCEC(_CD,ENTITY));
call symput('le',le);
*drop _:;
run;

Log:

NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds
      
WARNING: Argument 3 to macro function %SUBSTR is out of range.&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 07:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Out-of-Range-Warning/m-p/641539#M191213</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-21T07:54:58Z</dc:date>
    </item>
  </channel>
</rss>

