<?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: Macros for overall and single value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macros-for-overall-and-single-value/m-p/162141#M263402</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps try substituting the whole where clause, so instead of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; background-color: #ffffff;"&gt;where code= &amp;amp;Cod&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;amp;Cod&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you could invoke the macro as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;% Result (,&amp;nbsp;&amp;nbsp;&amp;nbsp; Report = Rpt1_overall);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;% Result (where Code =&amp;nbsp; 23 , Report = Rpt2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;% Result (where Code =&amp;nbsp; 43, Report = Rpt3);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;% Result (where Code =&amp;nbsp; 32, Report = Rpt4);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Feb 2014 17:51:41 GMT</pubDate>
    <dc:creator>Amir</dc:creator>
    <dc:date>2014-02-04T17:51:41Z</dc:date>
    <item>
      <title>Macros for overall and single value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-for-overall-and-single-value/m-p/162140#M263401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;Please have a look on this-&lt;/P&gt;&lt;P&gt;I have written one sql code and applied macros on it-&lt;/P&gt;&lt;P&gt;The Macro looks like-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%Macro&amp;nbsp; Result (Cod, Report);&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;connect to oracle (user=xxxx password=xxxx path='xxx');&lt;/P&gt;&lt;P&gt;create table One as select * from connection to oracle&lt;/P&gt;&lt;P&gt;( select&amp;nbsp;&amp;nbsp;&amp;nbsp; p1, p2, p3, Code&lt;/P&gt;&lt;P&gt;from Two&lt;/P&gt;&lt;P&gt;where code= &amp;amp;Cod;&lt;/P&gt;&lt;P&gt;disconnect from oracle;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data &amp;amp;report;&lt;/P&gt;&lt;P&gt;set one;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%Mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;% Result (Code =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&amp;nbsp;&amp;nbsp;&amp;nbsp; Report = Rpt1_overall);&lt;/P&gt;&lt;P&gt;% Result (Code =&amp;nbsp; 23 , Report = Rpt2);&lt;/P&gt;&lt;P&gt;% Result (Code =&amp;nbsp; 43, Report = Rpt3);&lt;/P&gt;&lt;P&gt;% Result (Code =&amp;nbsp; 32, Report = Rpt4);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, I don't have problem with last three macros but for the fist macro I don't want to define any code (value). in the proc sql step, I just want to select code, no 'where' condition.&lt;BR /&gt;So how can I do so?&lt;BR /&gt;Hope you understand this query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Dipu &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Feb 2014 16:35:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-for-overall-and-single-value/m-p/162140#M263401</guid>
      <dc:creator>Dipu</dc:creator>
      <dc:date>2014-02-04T16:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Macros for overall and single value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-for-overall-and-single-value/m-p/162141#M263402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps try substituting the whole where clause, so instead of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; background-color: #ffffff;"&gt;where code= &amp;amp;Cod&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;amp;Cod&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you could invoke the macro as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;% Result (,&amp;nbsp;&amp;nbsp;&amp;nbsp; Report = Rpt1_overall);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;% Result (where Code =&amp;nbsp; 23 , Report = Rpt2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;% Result (where Code =&amp;nbsp; 43, Report = Rpt3);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;% Result (where Code =&amp;nbsp; 32, Report = Rpt4);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Feb 2014 17:51:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-for-overall-and-single-value/m-p/162141#M263402</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2014-02-04T17:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Macros for overall and single value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-for-overall-and-single-value/m-p/162142#M263403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's another possibility you could try.&amp;nbsp; You currently have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from Two&lt;/P&gt;&lt;P&gt;where cod=&amp;amp;cod&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try replacing that with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from Two&lt;/P&gt;&lt;P&gt;%if %length(&amp;amp;cod) %then where cod=&amp;amp;cod;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, you do need both semicolons.&amp;nbsp; Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Feb 2014 19:55:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-for-overall-and-single-value/m-p/162142#M263403</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2014-02-04T19:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Macros for overall and single value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-for-overall-and-single-value/m-p/162143#M263404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Amir for your reply.&lt;/P&gt;&lt;P&gt;Actually it worked, I was just worried since I had various 'and' conditions so I did the same as you mentioned, for 'and'.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Dipu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Feb 2014 19:58:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-for-overall-and-single-value/m-p/162143#M263404</guid>
      <dc:creator>Dipu</dc:creator>
      <dc:date>2014-02-04T19:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: Macros for overall and single value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-for-overall-and-single-value/m-p/162144#M263405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you @ Astounding for your reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Feb 2014 20:13:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-for-overall-and-single-value/m-p/162144#M263405</guid>
      <dc:creator>Dipu</dc:creator>
      <dc:date>2014-02-04T20:13:46Z</dc:date>
    </item>
  </channel>
</rss>

