<?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: Can i pass a complete where condition into a dataset present within a macro?I need to use multip in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Can-i-pass-a-complete-where-condition-into-a-dataset-present/m-p/225173#M40401</link>
    <description>&lt;P&gt;Change the macro to have an additional parameter COND&lt;/P&gt;&lt;P&gt;Create a data set will the parameters you need to call the macro and use call execute&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%macro eye (eye,dat, id, cond);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%mend;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Your PROC SQL tables will get overwritten with each run though as they will all have the same name.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My example of call execute:&lt;/P&gt;&lt;P&gt;&lt;A href="https://gist.github.com/statgeek/beb97b1c6d4517dde3b2" target="_blank"&gt;https://gist.github.com/statgeek/beb97b1c6d4517dde3b2&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS Documentation example for call execute:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000543697.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000543697.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Sep 2015 14:39:06 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-09-11T14:39:06Z</dc:date>
    <item>
      <title>Can i pass a complete where condition into a dataset present within a macro?I need to use multiple where conditions for the same table which gives out multiple tables for each subgroup.Each where condition needs to use multiple variables.How can i do it?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-i-pass-a-complete-where-condition-into-a-dataset-present/m-p/211794#M39192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%macro eye (eye,dat, id); &lt;/P&gt;&lt;P&gt;data adae ; &lt;/P&gt;&lt;P&gt;&amp;nbsp; set adamdata.adae; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if STUDYGR1 ='Y' and AECAT=&amp;amp;eye and TRTEMFL='Y'&amp;nbsp; and AEBODSYS ne '' 1 ; *'Ocular'; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff6600;"&gt;&amp;nbsp;&amp;nbsp; where &amp;amp;cond1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&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;&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; /*Number of subjects TRTAN */&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table any as select&amp;nbsp; trtan, count(distinct usubjid) as cnt from adae where trtan ne . group by&amp;nbsp; trtan; &lt;/P&gt;&lt;P&gt;&amp;nbsp; create table soc as select AEBODSYS,trtan, count(distinct usubjid) as cnt from adae where trtan ne . group by AEBODSYS,trtan; &lt;/P&gt;&lt;P&gt;&amp;nbsp; create table pt as select AEDECOD, AEBODSYS, trtan, count(distinct usubjid) as cnt from adae where trtan ne . group by AEDECOD,AEBODSYS,trtan; &lt;/P&gt;&lt;P&gt;&amp;nbsp; quit; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend eye; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The where condition(in red color) needs to be modified for each table.&lt;/P&gt;&lt;P&gt;Eg: where ethnicity="Hispanic"&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;where ethnicity="Not Hispanic"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;where sex="Female"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;where sex="Male"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;where agegr1n=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;where agegr1n=2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;where agegr1n=3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;where agegr1n=4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;I need to pass all these where conditions in one program.How can i do that?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 21:24:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-i-pass-a-complete-where-condition-into-a-dataset-present/m-p/211794#M39192</guid>
      <dc:creator>reddyr1</dc:creator>
      <dc:date>2015-06-22T21:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Can i pass a complete where condition into a dataset present within a macro?I need to use multip</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-i-pass-a-complete-where-condition-into-a-dataset-present/m-p/225173#M40401</link>
      <description>&lt;P&gt;Change the macro to have an additional parameter COND&lt;/P&gt;&lt;P&gt;Create a data set will the parameters you need to call the macro and use call execute&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%macro eye (eye,dat, id, cond);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%mend;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Your PROC SQL tables will get overwritten with each run though as they will all have the same name.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My example of call execute:&lt;/P&gt;&lt;P&gt;&lt;A href="https://gist.github.com/statgeek/beb97b1c6d4517dde3b2" target="_blank"&gt;https://gist.github.com/statgeek/beb97b1c6d4517dde3b2&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS Documentation example for call execute:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000543697.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000543697.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2015 14:39:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-i-pass-a-complete-where-condition-into-a-dataset-present/m-p/225173#M40401</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-09-11T14:39:06Z</dc:date>
    </item>
  </channel>
</rss>

