<?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: Error while creating macro variable using SQL Into in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Error-while-creating-macro-variable-using-SQL-Into/m-p/287521#M59176</link>
    <description>&lt;P&gt;Note that you can adjust the size of the macro variable limit. The system option MVARSIZE can be used in an options statement to increase (or decrease) the limit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;options mvarsize=1M; for instance would set the limit to 1 megabyte. The numeric part of the option is limited in range 0&amp;nbsp;to 65534 but you may suffix that value with K (kilobytes), M (Megabytes0 and G(Gigabytes).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However I suspect that you might reconsider the approach that requires that long of a list.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jul 2016 16:32:22 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-07-27T16:32:22Z</dc:date>
    <item>
      <title>Error while creating macro variable using SQL Into</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-while-creating-macro-variable-using-SQL-Into/m-p/287474#M59157</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;HI Team ,&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;I am trying to create a macro variable to fetch only PI Claims like below and &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;create&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;table&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; PI_LOOKUP &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;as&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;select&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; *&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;from&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; connection to odbc&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;( &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;select&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;claim_id &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;AS&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; CLAIM_NBR&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;CLAIM_POL_REF&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;FONT color="#000080" face="Courier New"&gt;QUIT&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;FONT color="#000080" face="Courier New"&gt;SQL&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;noprint&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;SELECT&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New"&gt;&lt;FONT color="#800080" face="Courier New"&gt;"'"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; || STRIP(CLAIM_NBR) || &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New"&gt;&lt;FONT color="#800080" face="Courier New"&gt;"'"&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;INTO&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; : CLM_LIST_PI&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;SEPARATED &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;BY&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New"&gt;&lt;FONT color="#800080" face="Courier New"&gt;", "&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;FROM&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; PI_LOOKUP ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;QUIT&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;Iam getting the below error message&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: The length of the value of the macro variable CLM_LIST_PI (65540) exceeds the maximum length (65534). The value has&lt;/P&gt;&lt;P&gt;been truncated to 65534 characters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any restrictions up to a maximum leangth ? Please advice or suggest me how to create a macro variale in another method or way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&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, 27 Jul 2016 13:44:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-while-creating-macro-variable-using-SQL-Into/m-p/287474#M59157</guid>
      <dc:creator>ambadi007</dc:creator>
      <dc:date>2016-07-27T13:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Error while creating macro variable using SQL Into</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-while-creating-macro-variable-using-SQL-Into/m-p/287483#M59162</link>
      <description>&lt;P&gt;Yes, you have hit the limit. &amp;nbsp;Macro variables do have a maximum length.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like you may be intending to use the macro variable in a later WHERE clause such as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where claim_nbr in (&amp;amp;pi_lookup)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that's the case, you might get around the limit by using a subquery:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where claim_nbr in (select claim_nbr from pi_lookup)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note, if you have the possibility of duplicate claim numbers that you might add DISTINCT here and there.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2016 14:07:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-while-creating-macro-variable-using-SQL-Into/m-p/287483#M59162</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-07-27T14:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Error while creating macro variable using SQL Into</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-while-creating-macro-variable-using-SQL-Into/m-p/287521#M59176</link>
      <description>&lt;P&gt;Note that you can adjust the size of the macro variable limit. The system option MVARSIZE can be used in an options statement to increase (or decrease) the limit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;options mvarsize=1M; for instance would set the limit to 1 megabyte. The numeric part of the option is limited in range 0&amp;nbsp;to 65534 but you may suffix that value with K (kilobytes), M (Megabytes0 and G(Gigabytes).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However I suspect that you might reconsider the approach that requires that long of a list.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2016 16:32:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-while-creating-macro-variable-using-SQL-Into/m-p/287521#M59176</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-07-27T16:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Error while creating macro variable using SQL Into</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-while-creating-macro-variable-using-SQL-Into/m-p/478934#M123558</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having same problem . When I tried to use&amp;nbsp;&lt;SPAN&gt;MVARSIZE&amp;nbsp;I got error (ERROR 18-12: Option value for SAS option MVARSIZE must be between 0 and 65534.) . I also tried to use options MEXECSIZE but did not worrked. I am new to SAS so please if someone can help me&amp;nbsp;with this problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname lib '/folder/my';
OPTION MEXECSIZE=max;
option mvarsize=1M;
%macro fun;
*proc options mexecsize=10;
*run; 
/*proc OPTIONS MEXECSIZE=max;
run;  */



PROC SQL NOPRINT ;

CREATE TABLE lib.VAR_NAMES AS
  SELECT NAME FROM DICTIONARY.COLUMNS
        WHERE libname ='LIB' AND memname ='MGR';
        

SELECT COMPRESS(NAME) INTO :UNIT_VAR_LIST SEPARATED BY " " FROM lib.VAR_NAMES WHERE UPCASE(name) LIKE '%unit%' OR
UPCASE(name) LIKE UPCASE('%UNIT%');


SELECT COMPRESS(NAME) INTO :DLLR_VAR_LIST SEPARATED BY " " FROM lib.VAR_NAMES WHERE UPCASE(name) LIKE '%dllr%' OR
UPCASE(name) LIKE '%DLLR%';
QUIT;




%mend fun;

%fun;&lt;/CODE&gt;&lt;/PRE&gt;&lt;DIV class="dijitBorderContainer dijitContainer row-fluid dijitLayoutContainer"&gt;&lt;DIV class="dijitContentPane dijitBorderContainer-child dijitBorderContainer-dijitContentPane dijitBorderContainerPane dijitAlignCenter dijitContentPaneSingleChild"&gt;&lt;DIV class="dijitBorderContainer dijitContainer row-fluid dijitLayoutContainer"&gt;&lt;DIV class="dijitContentPane dijitAlignCenter dijitContentPaneSingleChild dijitBorderContainer-child dijitBorderContainer-dijitContentPane dijitBorderContainerPane"&gt;&lt;DIV class="tabs dijitBorderContainer dijitContainer dojoDndTarget sasStudioTabsParentContainer dijitLayoutContainer dojoDndContainerOver"&gt;&lt;DIV class="dijitTabContainer dijitTabContainerTop dijitContainer dijitLayoutContainer tabStrip-disabled sasStudioTabsTabContainer sasStudioTabsTabContainerVertical sasStudioTabsTop dijitBorderContainer-child dijitBorderContainer-dijitTabContainerTop dijitBorderContainerPane dijitAlignCenter"&gt;&lt;DIV class="dijitTabPaneWrapper dijitTabContainerTop-container dijitAlignCenter"&gt;&lt;DIV class="dijitTabContainerTopChildWrapper dijitVisible"&gt;&lt;DIV class="dijitBorderContainer dijitContainer sasStudioTabsTabContainerChild dijitTabPane dijitTabContainerTop-child dijitTabContainerTop-dijitBorderContainer dijitLayoutContainer"&gt;&lt;DIV class="dijitBorderContainer dijitContainer dojoDndTarget dijitBorderContainer-child dijitBorderContainer-dijitBorderContainer dijitBorderContainerPane dijitAlignCenter dijitLayoutContainer dojoDndContainerOver"&gt;&lt;DIV class="dijitTabContainer dijitTabContainerTop dijitContainer dijitLayoutContainer tabStrip-disabled sasSuiteTabs dijitBorderContainer-child dijitBorderContainer-dijitTabContainerTop dijitBorderContainerPane dijitAlignCenter"&gt;&lt;DIV class="dijitTabPaneWrapper dijitTabContainerTop-container dijitAlignCenter"&gt;&lt;DIV class="dijitTabContainerTopChildWrapper dijitVisible"&gt;&lt;DIV class="dijitBorderContainer dijitContainer dijitTabPane dijitTabContainerTop-child dijitTabContainerTop-dijitBorderContainer dijitLayoutContainer"&gt;&lt;DIV class="dijitBorderContainer dijitContainer dijitBorderContainer-child dijitBorderContainer-dijitBorderContainer dijitBorderContainerPane dijitAlignCenter dijitLayoutContainer"&gt;&lt;DIV class="dijitContentPane dijitBorderContainer-child dijitBorderContainer-dijitContentPane dijitBorderContainerPane dijitAlignCenter"&gt;&lt;DIV class="sasError focus-line"&gt;&amp;nbsp;&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;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 18 Jul 2018 07:24:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-while-creating-macro-variable-using-SQL-Into/m-p/478934#M123558</guid>
      <dc:creator>sam101</dc:creator>
      <dc:date>2018-07-18T07:24:49Z</dc:date>
    </item>
  </channel>
</rss>

