<?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: The text expression length (65572) exceeds maximum length (65534). The text expression ha in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-The-text-expression-length-65572-exceeds-maximum-length/m-p/612386#M178688</link>
    <description>&lt;P&gt;Sounds like you are trying to generate a list of variable labels, to use in another program, e.g.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data want;
  set have;
  label &amp;amp;label_list;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would consider writing the code to a temporary file instead:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename tempsas temp;
Data _null_;
  file tempsas;
  put 'label';
  do _N_=1 to nobs;
    set test nobs=nobs;
    dscr=quote(trim(dscr),"'");
    put name '=' dscr;
    end;
  put ';';
end;

data want;
  set have;
  %include tempsas;
run;
  
  &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 17 Dec 2019 13:27:36 GMT</pubDate>
    <dc:creator>s_lassen</dc:creator>
    <dc:date>2019-12-17T13:27:36Z</dc:date>
    <item>
      <title>ERROR: The text expression length (65572) exceeds maximum length (65534). The text expression has</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-The-text-expression-length-65572-exceeds-maximum-length/m-p/612353#M178668</link>
      <description>&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I encountered this error from running this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;EM&gt;ERROR: The text expression length (65572) exceeds maximum length (65534). The text expression has&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;&lt;EM&gt;been truncated to 65534 characters.&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select catx("=", NAME, quote(trim(dscr)))&lt;BR /&gt;into :label_list separated by " "&lt;BR /&gt;from test;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to solve this error?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know.&lt;/P&gt;&lt;P&gt;Many thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 10:40:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-The-text-expression-length-65572-exceeds-maximum-length/m-p/612353#M178668</guid>
      <dc:creator>ari</dc:creator>
      <dc:date>2019-12-17T10:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: The text expression length (65572) exceeds maximum length (65534). The text expression ha</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-The-text-expression-length-65572-exceeds-maximum-length/m-p/612354#M178669</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What are you creating this macrovariables list for ?&lt;/P&gt;
&lt;P&gt;Macro language is not meant to be used to manipulate data.&lt;/P&gt;
&lt;P&gt;So the solution would be not to create this list of macrovariables and&lt;/P&gt;
&lt;P&gt;use bases SAS language to achieve your goal.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 10:51:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-The-text-expression-length-65572-exceeds-maximum-length/m-p/612354#M178669</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2019-12-17T10:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: The text expression length (65572) exceeds maximum length (65534). The text expression ha</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-The-text-expression-length-65572-exceeds-maximum-length/m-p/612360#M178674</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/82839"&gt;@ari&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to solve this error?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes. Stop abusing macro variables for things they are not meant for.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt; belongs in &lt;STRONG&gt;DATA&lt;/STRONG&gt;SETS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can always use your above select as a sub-select in SQL, load a hash object in a data step from it, or create a format. Or do a join, which will scale up until you run out of disk storage.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 11:47:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-The-text-expression-length-65572-exceeds-maximum-length/m-p/612360#M178674</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-17T11:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: The text expression length (65572) exceeds maximum length (65534). The text expression ha</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-The-text-expression-length-65572-exceeds-maximum-length/m-p/612386#M178688</link>
      <description>&lt;P&gt;Sounds like you are trying to generate a list of variable labels, to use in another program, e.g.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data want;
  set have;
  label &amp;amp;label_list;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would consider writing the code to a temporary file instead:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename tempsas temp;
Data _null_;
  file tempsas;
  put 'label';
  do _N_=1 to nobs;
    set test nobs=nobs;
    dscr=quote(trim(dscr),"'");
    put name '=' dscr;
    end;
  put ';';
end;

data want;
  set have;
  %include tempsas;
run;
  
  &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Dec 2019 13:27:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-The-text-expression-length-65572-exceeds-maximum-length/m-p/612386#M178688</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2019-12-17T13:27:36Z</dc:date>
    </item>
  </channel>
</rss>

