<?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 Quote Macro Input Data Set in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Quote-Macro-Input-Data-Set/m-p/88454#M25244</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to check if there's a certain variable named "ABC"&amp;nbsp; in the input data set. I can realize it using the following data step:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;dsid=open('have');&lt;/P&gt;&lt;P&gt;check=varnum(dsid,'ABC');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will check 'check' and use it for further programming. Now I want to realize the same function using a macro. I have tried the following but it didn't work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro test(&amp;amp;input);&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set &amp;amp;input;&lt;/P&gt;&lt;P&gt;dsid=open('&amp;amp;input');&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *The problem might be here;&lt;/P&gt;&lt;P&gt;check=varnum(dsid,'ABC');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%test(xxxx)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone offer some help? Thank you so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 May 2013 23:21:46 GMT</pubDate>
    <dc:creator>PeterPanPan</dc:creator>
    <dc:date>2013-05-28T23:21:46Z</dc:date>
    <item>
      <title>Quote Macro Input Data Set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Quote-Macro-Input-Data-Set/m-p/88454#M25244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to check if there's a certain variable named "ABC"&amp;nbsp; in the input data set. I can realize it using the following data step:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;dsid=open('have');&lt;/P&gt;&lt;P&gt;check=varnum(dsid,'ABC');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will check 'check' and use it for further programming. Now I want to realize the same function using a macro. I have tried the following but it didn't work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro test(&amp;amp;input);&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set &amp;amp;input;&lt;/P&gt;&lt;P&gt;dsid=open('&amp;amp;input');&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *The problem might be here;&lt;/P&gt;&lt;P&gt;check=varnum(dsid,'ABC');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%test(xxxx)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone offer some help? Thank you so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 23:21:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Quote-Macro-Input-Data-Set/m-p/88454#M25244</guid>
      <dc:creator>PeterPanPan</dc:creator>
      <dc:date>2013-05-28T23:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: Quote Macro Input Data Set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Quote-Macro-Input-Data-Set/m-p/88455#M25245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;macro variables only result inside double quotes, not single quotes. &lt;/P&gt;&lt;P&gt;Change to double quotes. &lt;/P&gt;&lt;P&gt;You may also want to consider looking at capturing the outputs of proc contents or querying the dictionary table instead. These are especially useful when your data is large. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 23:47:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Quote-Macro-Input-Data-Set/m-p/88455#M25245</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-05-28T23:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Quote Macro Input Data Set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Quote-Macro-Input-Data-Set/m-p/88456#M25246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use double quotes so your &amp;amp;input will resolve: "&amp;amp;input"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 23:52:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Quote-Macro-Input-Data-Set/m-p/88456#M25246</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2013-05-28T23:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: Quote Macro Input Data Set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Quote-Macro-Input-Data-Set/m-p/88457#M25247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 23:54:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Quote-Macro-Input-Data-Set/m-p/88457#M25247</guid>
      <dc:creator>PeterPanPan</dc:creator>
      <dc:date>2013-05-28T23:54:37Z</dc:date>
    </item>
  </channel>
</rss>

