<?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: HOW TO SELECT MULTIPLE VALUES USING WHERE IN CONDITION WITHIN MACRO USING PROC SQL? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-SELECT-MULTIPLE-VALUES-USING-WHERE-IN-CONDITION-WITHIN/m-p/495528#M130788</link>
    <description>&lt;P&gt;I would want to know if the SQL correctly runs by itself outside the macro and I would want to put single quotes on Accept.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Sep 2018 21:17:36 GMT</pubDate>
    <dc:creator>HB</dc:creator>
    <dc:date>2018-09-13T21:17:36Z</dc:date>
    <item>
      <title>HOW TO SELECT MULTIPLE VALUES USING WHERE IN CONDITION WITHIN MACRO USING PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-SELECT-MULTIPLE-VALUES-USING-WHERE-IN-CONDITION-WITHIN/m-p/495021#M130575</link>
      <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've written the following macro to use proc sql to perfom a left join on two tables according to certain conditions. The macro works when the where clause references one&amp;nbsp; variable value ('TYPE'), but not on several variable values. Anyone know how can I adjust this so that I can perform this join for several possible variable values using the conditional "where" "in"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd appreciate some advice on this issue!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%MACRO JOINSUBSET(LIB=, DSN=, MAINFORM=, SUBFORM=, DSTYPE=, TYPE=)/MINOPERATOR;&lt;/P&gt;&lt;P&gt;%IF &amp;amp;TYPE IN Accepted Denied Pending Revoked %THEN %DO;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;PROC SQL;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CREATE TABLE &amp;amp;LIB..SUM_&amp;amp;MAINFORM._&amp;amp;SUBFORM._&amp;amp;DSTYPE AS&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SELECT a.ACT_YEAR, a.ACT_MONTH,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; COUNT(DISTINCT a.RECEIPT_NUMBER) AS COUNT&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FROM &amp;amp;LIB..&amp;amp;DSN.&amp;amp;MAINFORM a LEFT JOIN&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;amp;LIB..&amp;amp;DSN.&amp;amp;SUBFORM b&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ON a.IDENTIFIER=b.IDENTIFIER&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;WHERE a.CURRENT_STATUS IN (SELECT "&amp;amp;TYPE" FROM &amp;amp;LIB..&amp;amp;DSN.&amp;amp;MAINFORM )&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AND b.DATA_TYPE="Accept"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GROUP BY a.ACT_YEAR, a.ACT_MONTH;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;QUIT;&lt;BR /&gt;&lt;BR /&gt;%END;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%MEND JOINSUBSET;&lt;/P&gt;&lt;P&gt;%JOINSUBSET(LIB=SASUSER, DSN=DATASET_, MAINFORM=S23, SUBFORM=X54, DSTYPE=DENIED, TYPE=Denied Revoked)&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 20:29:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-SELECT-MULTIPLE-VALUES-USING-WHERE-IN-CONDITION-WITHIN/m-p/495021#M130575</guid>
      <dc:creator>atiedt</dc:creator>
      <dc:date>2018-09-12T20:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO SELECT MULTIPLE VALUES USING WHERE IN CONDITION WITHIN MACRO USING PROC SQL?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-SELECT-MULTIPLE-VALUES-USING-WHERE-IN-CONDITION-WITHIN/m-p/495528#M130788</link>
      <description>&lt;P&gt;I would want to know if the SQL correctly runs by itself outside the macro and I would want to put single quotes on Accept.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 21:17:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-SELECT-MULTIPLE-VALUES-USING-WHERE-IN-CONDITION-WITHIN/m-p/495528#M130788</guid>
      <dc:creator>HB</dc:creator>
      <dc:date>2018-09-13T21:17:36Z</dc:date>
    </item>
  </channel>
</rss>

