<?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: Resolving a macro variable of having length 65k in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Resolving-a-macro-variable-of-having-length-65k/m-p/448951#M112943</link>
    <description>&lt;P&gt;Instead of saving it into a single macro, you can use CALL SYMPUT in data step and create multiple macro variables depending on the condition you have and later you can call them as needed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Mar 2018 12:38:25 GMT</pubDate>
    <dc:creator>SuryaKiran</dc:creator>
    <dc:date>2018-03-27T12:38:25Z</dc:date>
    <item>
      <title>Resolving a macro variable of having length 65k</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resolving-a-macro-variable-of-having-length-65k/m-p/448931#M112935</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc sql;&lt;/P&gt;&lt;P&gt;select data into &amp;nbsp;:data_macro seperated by "," from xyz;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lets assume data_macro recorded a string of 65k length.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;data_list="&amp;amp;data_macro"; /*Here error comes of truncation*/&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since character varibale can store max 32767 byte of data i am wondering how will i able to store this macro value into my dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly suggest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 11:32:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resolving-a-macro-variable-of-having-length-65k/m-p/448931#M112935</guid>
      <dc:creator>Attyslogin</dc:creator>
      <dc:date>2018-03-27T11:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Resolving a macro variable of having length 65k</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resolving-a-macro-variable-of-having-length-65k/m-p/448934#M112936</link>
      <description>&lt;P&gt;Since the data is originally stored in a column over all (or multiple) rows, I'd keep it that way and use it from there. Adapt your process to the structure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With an arbitrary number of rows, sooner or later you'll crack the 65k limit of the macro variable and lose data there. So your process as such is not valid.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 11:41:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resolving-a-macro-variable-of-having-length-65k/m-p/448934#M112936</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-27T11:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Resolving a macro variable of having length 65k</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resolving-a-macro-variable-of-having-length-65k/m-p/448939#M112938</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;data test;&lt;/P&gt;
&lt;P&gt;data_list="&amp;amp;data_macro"; /*Here error comes of truncation*/&amp;nbsp;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't imagine a reason to do this, why you'd want to create a data step variable that long from a macro variable, what is the point?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But when you start dealing with large amounts of text like this, the idea of making a huge long text string or huge long macro variable is not a good one. Using a&amp;nbsp;function&amp;nbsp;like CALL EXECUTE, you can actually work with arbitrarily large amounts of text, if you do it properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 11:56:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resolving-a-macro-variable-of-having-length-65k/m-p/448939#M112938</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-03-27T11:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Resolving a macro variable of having length 65k</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resolving-a-macro-variable-of-having-length-65k/m-p/448944#M112940</link>
      <description>&lt;P&gt;There is a simple answer DON'T.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you describe the larger problem I am sure there is a way to solve it without creating strings anywhere near the 32K limit for a variable to or the 64K limit for a macro variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you really want to generate really long strings from your data then just do that and skip the macro variable step.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test ;
  length row 8 data_list $500 ;
  do row=1 by 1 until (eof or length(data_list) &amp;gt; 450) ;
    set xyz end=eof ;
    data_list = catx(',',data_list,data);
  end;
  keep row data_list ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Mar 2018 12:12:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resolving-a-macro-variable-of-having-length-65k/m-p/448944#M112940</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-03-27T12:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Resolving a macro variable of having length 65k</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resolving-a-macro-variable-of-having-length-65k/m-p/448951#M112943</link>
      <description>&lt;P&gt;Instead of saving it into a single macro, you can use CALL SYMPUT in data step and create multiple macro variables depending on the condition you have and later you can call them as needed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 12:38:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resolving-a-macro-variable-of-having-length-65k/m-p/448951#M112943</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-03-27T12:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: Resolving a macro variable of having length 65k</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resolving-a-macro-variable-of-having-length-65k/m-p/448983#M112948</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88783"&gt;@Attyslogin&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc sql;&lt;/P&gt;
&lt;P&gt;select data into &amp;nbsp;:data_macro seperated by "," from xyz;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lets assume data_macro recorded a string of 65k length.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test;&lt;/P&gt;
&lt;P&gt;data_list="&amp;amp;data_macro"; /*Here error comes of truncation*/&amp;nbsp;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since character varibale can store max 32767 byte of data i am wondering how will i able to store this macro value into my dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kindly suggest.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And just what were you going to do with the data step variable data_list?&lt;/P&gt;
&lt;P&gt;Sticking that many data values into macro variables is almost always an indication of attempting to do something in the macro facility it was not designed for. Not to mention what is going to be done with one variable roughly the equivalent of 300 pages of text...&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 14:20:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resolving-a-macro-variable-of-having-length-65k/m-p/448983#M112948</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-03-27T14:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Resolving a macro variable of having length 65k</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resolving-a-macro-variable-of-having-length-65k/m-p/449022#M112955</link>
      <description>&lt;P&gt;See the recommendation here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/39/605.html" target="_blank"&gt;http://support.sas.com/kb/39/605.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check the full code tab for the code.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 15:37:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resolving-a-macro-variable-of-having-length-65k/m-p/449022#M112955</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-27T15:37:16Z</dc:date>
    </item>
  </channel>
</rss>

