<?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: I can't increase macro variable limit in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585889#M14401</link>
    <description>&lt;P&gt;Post a &lt;STRONG&gt;clear sample&lt;/STRONG&gt; of your requirement. The requirement's solution is to use &lt;EM&gt;&lt;STRONG&gt;look up tables&lt;/STRONG&gt;&lt;/EM&gt; rather than large macro vars. What kind of look up tables, be it format/hash/join/array, leave that for the community to offer.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Sep 2019 17:21:57 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2019-09-03T17:21:57Z</dc:date>
    <item>
      <title>I can't increase macro variable limit</title>
      <link>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585878#M14394</link>
      <description>&lt;P&gt;&lt;EM&gt;Hi,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;i am trying to get some data, based on a macro variable, but get the error&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ERROR: The length of the value of the macro variable LISTA_DESTINATARIOS (65540) exceeds the maximum length (65534). The value has &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Been truncated to 65534 characters.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I tried do make de macro limit bigger with&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Options mexecsize=800000;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Options MVARSIZE =800000;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Options MSYMTABMAX=800000;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;But doesn’t work, i get de error:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ERROR 18-12: Option value for SAS option MVARSIZE must be between 0 and 65534&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;i tried do get de date of using a table instead of a macro variable but the query keep running for ever, a think this happen because of something about get data from oracle tables and sas tables. With macro almost work, i can get the date until reach macro limit.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;not English native speaker pls be patient&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I am using SAS Enterprise Guide 7.1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;thanks a lot&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 16:49:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585878#M14394</guid>
      <dc:creator>Moacyr007</dc:creator>
      <dc:date>2019-09-03T16:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: I can't increase macro variable limit</title>
      <link>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585882#M14395</link>
      <description>You cannot increase the size of macro variables beyond a certain limit. If you check the documentation you'll see there's a maximum value of 65,534, which you're trying to go beyond. If you explain your use case we can likely offer alternative options.</description>
      <pubDate>Tue, 03 Sep 2019 16:55:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585882#M14395</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-03T16:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: I can't increase macro variable limit</title>
      <link>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585883#M14396</link>
      <description>&lt;P&gt;The maximum size of a macro variable is 64K, period. It's a constructive limit of SAS software, just like the 32K limit for character variables in datasets and data steps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What are you trying to store in the macro variable, and how do you do it?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 16:55:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585883#M14396</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-09-03T16:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: I can't increase macro variable limit</title>
      <link>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585888#M14400</link>
      <description>i am storing 19k rows of numbers with 6 to 14 digits, with&lt;BR /&gt;&lt;BR /&gt;SELECT DISTINCT NUMR_PESSOA INTO :LISTA_EMISSORES SEPARATED BY ',' FROM WORK.QUERY_LISTA_EMISSORES;&lt;BR /&gt;&lt;BR /&gt;I use these numbers later on a where statement, i tried use a select in the where but just keep running and doesn't end&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Sep 2019 17:11:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585888#M14400</guid>
      <dc:creator>Moacyr007</dc:creator>
      <dc:date>2019-09-03T17:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: I can't increase macro variable limit</title>
      <link>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585889#M14401</link>
      <description>&lt;P&gt;Post a &lt;STRONG&gt;clear sample&lt;/STRONG&gt; of your requirement. The requirement's solution is to use &lt;EM&gt;&lt;STRONG&gt;look up tables&lt;/STRONG&gt;&lt;/EM&gt; rather than large macro vars. What kind of look up tables, be it format/hash/join/array, leave that for the community to offer.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 17:21:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585889#M14401</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-03T17:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: I can't increase macro variable limit</title>
      <link>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585890#M14402</link>
      <description>&lt;P&gt;Do a join on those numbers, or use a hash object in a data step. This is absolutely NOT what the macro language is made for.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 17:22:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585890#M14402</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-09-03T17:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: I can't increase macro variable limit</title>
      <link>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585896#M14405</link>
      <description>&lt;P&gt;If you really, really need to stuff a lot of information into macro variables then look at this answer.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/New-SAS-User/Using-INTO-to-create-a-macro-variable-for-pass-through-teradata/m-p/555231/highlight/true#M9637" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/New-SAS-User/Using-INTO-to-create-a-macro-variable-for-pass-through-teradata/m-p/555231/highlight/true#M9637&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The idea is to create multiple macro variables that each have some of the the list and then create another master macro variable that has references to the others.&lt;/P&gt;
&lt;P&gt;So instead of&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let list=1 2 3 4 5 6 7 8 9;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You do something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let list1=1 2 3  ;
%let list2=4 5 6 ;
%let list3=7 8 9;
data _null_;
 call symputx('list','&amp;amp;list1 &amp;amp;list2 &amp;amp;list3');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then when you reference &amp;amp;LIST you get all three of the other macro variables expanded.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another method is to use a data step to generate the code from the data. Either with CALL EXECUTE() or by writing to a text files and using %INCLUDE to run the generated code.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 17:36:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585896#M14405</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-09-03T17:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: I can't increase macro variable limit</title>
      <link>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585903#M14407</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/273648"&gt;@Moacyr007&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;i am storing 19k rows of numbers with 6 to 14 digits, with&lt;BR /&gt;&lt;BR /&gt;SELECT DISTINCT NUMR_PESSOA INTO :LISTA_EMISSORES SEPARATED BY ',' FROM WORK.QUERY_LISTA_EMISSORES;&lt;BR /&gt;&lt;BR /&gt;I use these numbers later on a where statement, i tried use a select in the where but just keep running and doesn't end&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;CALL EXECUTE may help here (depending on what you are doing), and there is no maximum character limit when you use CALL EXECUTE.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 17:47:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585903#M14407</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-03T17:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: I can't increase macro variable limit</title>
      <link>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585915#M14410</link>
      <description>&lt;P&gt;Now that I have another minute, you want a WHERE clause that has the 19000 numbers, something like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where variable in (1,2,3,...,19000)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;except that the numbers inside the parenthesis are not the sequential numbers 1 through 19000, they are the 6 to 14 digit values of variable&amp;nbsp;&lt;SPAN&gt;NUMR_PESSOA.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Is that what you are going for? If so, then I stick with my comment above, this ought to be relatively easy using CALL EXECUTE. If I had more free time today, I could write the code for you. I'm sure someone else will jump in.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 18:55:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585915#M14410</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-03T18:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: I can't increase macro variable limit</title>
      <link>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585971#M14425</link>
      <description>You can also generate a macro that will just put those values into the WHERE statement. SAS used to have a usage example of how to do that but it disappeared for some reason.</description>
      <pubDate>Tue, 03 Sep 2019 22:25:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/585971#M14425</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-03T22:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: I can't increase macro variable limit</title>
      <link>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/586281#M14451</link>
      <description>&lt;P&gt;And an approach using Proc Format:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Proc sql;
   create table listcntlin as
   SELECT DISTINCT NUMR_PESSOA as start,'Match' as Label 
       ,'MyList' as Fmtname, 'N' as type 
FROM WORK.QUERY_LISTA_EMISSORES; 

proc format library=work cntlin=listcntlin;
run;

data example;
   set somedataset;
   where put(variable,Mylist.)='Match';
run;
proc sql;
   create table example2 as
   select *
   from somedataset
   where put(variable,Mylist.)='Match'
   ;
quit;&lt;/PRE&gt;
&lt;P&gt;If you need the same list of values then make that a format in a permanent library in your FMTSEARCH path. If not, then this goes away at the end of your session like macro variables. And does not hit the macro space at all.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2019 22:49:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/I-can-t-increase-macro-variable-limit/m-p/586281#M14451</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-04T22:49:22Z</dc:date>
    </item>
  </channel>
</rss>

