<?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: Length of macro variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Length-of-macro-variable/m-p/89997#M19100</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All distinct values will be selected but your string must be longer than the 65k character length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can check if that is the case by calculating the number of distinct network ID and then multiplying by 3+ length of network id: total length ~ # of distinct * (length of networkID + 3).&lt;/P&gt;&lt;P&gt;If thats close to 65K then you have a problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Jan 2013 19:26:30 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2013-01-29T19:26:30Z</dc:date>
    <item>
      <title>Length of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-of-macro-variable/m-p/89994#M19097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select distinct "'"||compress(networkid)||"'"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into :nwid SEPaRATED BY ","&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from a1.nw_master&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where srv&amp;gt;0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table&amp;nbsp; a2.network_links as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from a1.nw_linkages&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where id in (&amp;amp;&amp;amp;nwid.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: The length of the value of the macro variable NWID (987973) exceeds the maximum length (65534). The value has been truncated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; to 65534 characters.&lt;/P&gt;&lt;P&gt;I thought all distinct values will be selected into nwid macro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 19:09:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-of-macro-variable/m-p/89994#M19097</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2013-01-29T19:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: Length of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-of-macro-variable/m-p/89995#M19098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure you need the double ampersand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 19:19:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-of-macro-variable/m-p/89995#M19098</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2013-01-29T19:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: Length of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-of-macro-variable/m-p/89996#M19099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This example is contrived but shows what you "could" do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;sql&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; sashelp.class&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; name &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; name &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; sashelp.class &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; sex eq &lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;'M'&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;quit&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 19:19:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-of-macro-variable/m-p/89996#M19099</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-01-29T19:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Length of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-of-macro-variable/m-p/89997#M19100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All distinct values will be selected but your string must be longer than the 65k character length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can check if that is the case by calculating the number of distinct network ID and then multiplying by 3+ length of network id: total length ~ # of distinct * (length of networkID + 3).&lt;/P&gt;&lt;P&gt;If thats close to 65K then you have a problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 19:26:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-of-macro-variable/m-p/89997#M19100</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-01-29T19:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Length of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-of-macro-variable/m-p/89998#M19101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok..If it greater than 65K sas cannot handle isnt it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 19:32:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-of-macro-variable/m-p/89998#M19101</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2013-01-29T19:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Length of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-of-macro-variable/m-p/89999#M19102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't need the macro variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 19:34:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-of-macro-variable/m-p/89999#M19102</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-01-29T19:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Length of macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-of-macro-variable/m-p/90000#M19103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use a subquery as shown by Data _null_ or create a macro like identified in this link:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/39/605.html?utm_source=dlvr.it&amp;amp;utm_medium=twitter" title="http://support.sas.com/kb/39/605.html?utm_source=dlvr.it&amp;amp;utm_medium=twitter"&gt;39605 - Create a string that goes beyond the 64K limit for macro variables&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd go with a subquery, since both tables seem to be in the same location and it would be the fastest.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 19:35:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-of-macro-variable/m-p/90000#M19103</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-01-29T19:35:42Z</dc:date>
    </item>
  </channel>
</rss>

