<?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: How big a SAS macro variable can take? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-big-a-SAS-macro-variable-can-take/m-p/277376#M58748</link>
    <description>&lt;P&gt;The system option MVARSIZE controls the size limit&amp;nbsp;of a single macro variable and allows assigning some pretty large values&lt;/P&gt;
&lt;P&gt;You can change it using an option statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;options mvarsize=32000; would set the max size to 32000 bytes&lt;/P&gt;
&lt;P&gt;options mvarsize-32000&lt;STRONG&gt;K&lt;/STRONG&gt;; would set the max size to 32000 kilobytes.&lt;/P&gt;
&lt;P&gt;Use M for megabyts and G for Gigabytes. The maximun number allowed in the assignement is 65534.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HOWEVER you have to pay attention to the maximum total amount of memory assigned to all macro variables which is similary controlled by the MSYMTABMAX option setting. If you use most of the memory for a single macro variable you may not be able to assign other macro variables within memory and the system will start spending a lot of time writing macro values to disk and then rereading.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4877"&gt;@Haikuo﻿&lt;/a&gt; mentions there are often better ways to handle things when you start bumping up against memory limits for macros.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jun 2016 21:06:10 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-06-14T21:06:10Z</dc:date>
    <item>
      <title>How big a SAS macro variable can take?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-big-a-SAS-macro-variable-can-take/m-p/277369#M58746</link>
      <description>&lt;P&gt;I want use sas sql to crate a new macro:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;proc sql;&lt;/P&gt;
&lt;P&gt;select&amp;nbsp;xyz into &amp;nbsp;:&amp;nbsp;abc separated by ',' from large_data;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;to create a new macro variable,,if dataset large_data has very large observations&amp;nbsp;.&amp;nbsp; &amp;nbsp;I am not sure how the new macro &amp;amp;abc&amp;nbsp;can load it. and is there any option to modify the macro size to load a large size value?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2016 20:17:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-big-a-SAS-macro-variable-can-take/m-p/277369#M58746</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2016-06-14T20:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: How big a SAS macro variable can take?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-big-a-SAS-macro-variable-can-take/m-p/277371#M58747</link>
      <description>&lt;P&gt;Nope. The max length of a macro variable is &lt;STRONG&gt;65534 chars.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Very often when you encounter something like this (system limit), there&amp;nbsp;are&amp;nbsp;better alternatives, some even without&amp;nbsp;involving macro variables. Please explain your whole picture.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2016 20:24:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-big-a-SAS-macro-variable-can-take/m-p/277371#M58747</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2016-06-14T20:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: How big a SAS macro variable can take?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-big-a-SAS-macro-variable-can-take/m-p/277376#M58748</link>
      <description>&lt;P&gt;The system option MVARSIZE controls the size limit&amp;nbsp;of a single macro variable and allows assigning some pretty large values&lt;/P&gt;
&lt;P&gt;You can change it using an option statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;options mvarsize=32000; would set the max size to 32000 bytes&lt;/P&gt;
&lt;P&gt;options mvarsize-32000&lt;STRONG&gt;K&lt;/STRONG&gt;; would set the max size to 32000 kilobytes.&lt;/P&gt;
&lt;P&gt;Use M for megabyts and G for Gigabytes. The maximun number allowed in the assignement is 65534.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HOWEVER you have to pay attention to the maximum total amount of memory assigned to all macro variables which is similary controlled by the MSYMTABMAX option setting. If you use most of the memory for a single macro variable you may not be able to assign other macro variables within memory and the system will start spending a lot of time writing macro values to disk and then rereading.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4877"&gt;@Haikuo﻿&lt;/a&gt; mentions there are often better ways to handle things when you start bumping up against memory limits for macros.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2016 21:06:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-big-a-SAS-macro-variable-can-take/m-p/277376#M58748</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-06-14T21:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: How big a SAS macro variable can take?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-big-a-SAS-macro-variable-can-take/m-p/277381#M58749</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One thing learned.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;Haikuo&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2016 20:53:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-big-a-SAS-macro-variable-can-take/m-p/277381#M58749</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2016-06-14T20:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: How big a SAS macro variable can take?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-big-a-SAS-macro-variable-can-take/m-p/277390#M58750</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4877"&gt;@Haikuo&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One thing learned.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;Haikuo&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I've been programming in SAS off and on for almost 30 years. I have never had to actually use the MVARSIZE and related options.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2016 21:07:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-big-a-SAS-macro-variable-can-take/m-p/277390#M58750</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-06-14T21:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: How big a SAS macro variable can take?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-big-a-SAS-macro-variable-can-take/m-p/277778#M58778</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MVARSIZE set the maximum&lt;STRONG&gt; in-memory&lt;/STRONG&gt; size. The default is 4k. The maximum size for macro variables is still&amp;nbsp;64k sadly.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 21:05:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-big-a-SAS-macro-variable-can-take/m-p/277778#M58778</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2016-06-16T21:05:42Z</dc:date>
    </item>
  </channel>
</rss>

