<?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: Dropping &amp;varlist within a macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Dropping-varlist-within-a-macro/m-p/190685#M304491</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd think you'd get the error both inside and outside a macro. You have an extra semi-colon and 2 where statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt; select strip(_NAME_) into : varlist separated by ' '&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; from to_drop&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where _NAME_ ne '_TYPE_' and&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; _NAME_ ne '_FREQ_'&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Jan 2015 17:22:42 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2015-01-20T17:22:42Z</dc:date>
    <item>
      <title>Dropping &amp;varlist within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dropping-varlist-within-a-macro/m-p/190684#M304490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This question is a continuation of a question I have asked earlier but it is a different problem hence I've started a new discussion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to eliminate a list of variables from my data set. The below code is part of a macro. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;select strip(_NAME_) into : varlist separated by ' '&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from to_drop&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where _NAME_ ne '_TYPE_';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where _NAME_ ne '_FREQ_';&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data inputds_factor;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set &amp;amp;input (drop=&amp;amp;varlist);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;When the above steps execute, I get the error below: &lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'SAS Monospace';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'SAS Monospace';"&gt;ERROR: The following columns were not found in the contributing tables: _NAME_.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'SAS Monospace';"&gt;WARNING: This SAS global statement is not supported in PROC SQL. It has been ignored.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'SAS Monospace';"&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'SAS Monospace';"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'SAS Monospace';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'SAS Monospace';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'SAS Monospace';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'SAS Monospace';"&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;When I execute the code, outside the macro, I don't get this error. How can I overcome this problem? &lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 17:06:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dropping-varlist-within-a-macro/m-p/190684#M304490</guid>
      <dc:creator>ngnikhilgoyal</dc:creator>
      <dc:date>2015-01-20T17:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dropping &amp;varlist within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dropping-varlist-within-a-macro/m-p/190685#M304491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd think you'd get the error both inside and outside a macro. You have an extra semi-colon and 2 where statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt; select strip(_NAME_) into : varlist separated by ' '&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; from to_drop&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where _NAME_ ne '_TYPE_' and&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; _NAME_ ne '_FREQ_'&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 17:22:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dropping-varlist-within-a-macro/m-p/190685#M304491</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2015-01-20T17:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Dropping &amp;varlist within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dropping-varlist-within-a-macro/m-p/190686#M304492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you done a %put &amp;amp;varlist in the macro to see what the value of the list is? What does it look like?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you could suppress those two variables at creation time if desired and using proc means or summary with dataset options:&lt;/P&gt;&lt;P&gt;output out=to_drop (drop=_TYPE_ _FREQ_) &amp;lt;rest of output options&amp;gt; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How the data set to_drop is built may have something to do with the result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 17:26:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dropping-varlist-within-a-macro/m-p/190686#M304492</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-01-20T17:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Dropping &amp;varlist within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dropping-varlist-within-a-macro/m-p/190687#M304493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; where _NAME_ not in&amp;nbsp; ('_TYPE_'&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; '_FREQ_')&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 06:56:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dropping-varlist-within-a-macro/m-p/190687#M304493</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-01-21T06:56:58Z</dc:date>
    </item>
  </channel>
</rss>

