<?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: Conditional Statement in PROC in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Conditional-Statement-in-PROC/m-p/211370#M39134</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. Functions in macro code you need to use %sysfunc&lt;/P&gt;&lt;P&gt;2. I think you mean to check if Countw is greater than 0, not equal to 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps something like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;%IF %sysfunc(countw(&amp;amp;charvars)) &amp;gt; 0 %THEN;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;class &amp;amp;charvars / param = ref;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;%END;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 26 Jul 2015 16:52:38 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-07-26T16:52:38Z</dc:date>
    <item>
      <title>Conditional Statement in PROC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-Statement-in-PROC/m-p/211369#M39133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to write IF-THEN-ELSE statement under any procedure?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro (depvar=,numvars=,charvars=);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc logistic data = abc descending;&lt;/P&gt;&lt;P&gt;class &amp;amp;charvars / param = ref;&lt;/P&gt;&lt;P&gt;model &amp;amp;depvar = &amp;amp;numvars &amp;amp;charvars / selection = stepwise;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;%mend;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I want the following statement wrapped in IF THEN condition. It should run only if an user specify variable(s) in CHARVARS parameter in the macro.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;class &amp;amp;charvars / param = ref;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Something like this : &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;proc logistic data = abc descending;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;%IF countw(&amp;amp;charvars) = 0 %THEN;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;class &amp;amp;charvars / param = ref;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;%END;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;model &amp;amp;depvar = &amp;amp;numvars &lt;STRONG&gt;&amp;amp;charvars&lt;/STRONG&gt; / selection = stepwise;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Jul 2015 15:56:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-Statement-in-PROC/m-p/211369#M39133</guid>
      <dc:creator>Ujjawal</dc:creator>
      <dc:date>2015-07-26T15:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Statement in PROC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-Statement-in-PROC/m-p/211370#M39134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. Functions in macro code you need to use %sysfunc&lt;/P&gt;&lt;P&gt;2. I think you mean to check if Countw is greater than 0, not equal to 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps something like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;%IF %sysfunc(countw(&amp;amp;charvars)) &amp;gt; 0 %THEN;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;class &amp;amp;charvars / param = ref;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;%END;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Jul 2015 16:52:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-Statement-in-PROC/m-p/211370#M39134</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-07-26T16:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Statement in PROC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-Statement-in-PROC/m-p/211371#M39135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;%IF &amp;amp;CHARVARS ^= %STR( ) %THEN %DO; CLASS...; %END;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 16:16:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-Statement-in-PROC/m-p/211371#M39135</guid>
      <dc:creator>ndp</dc:creator>
      <dc:date>2015-07-27T16:16:41Z</dc:date>
    </item>
  </channel>
</rss>

