<?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: Run the whole code on the base of condition in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Run-the-whole-code-on-the-base-of-condition/m-p/450074#M283657</link>
    <description>&lt;P&gt;You can use next skiltom:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro(choose);
     data _null_;
       set any_data;
             if &amp;lt;condition&amp;gt; 
                then call symput('flag',1);
                else call symput('flag',0);
     run;
     
     %if &amp;amp;flag = 1 %then do;
           &amp;lt;program 1&amp;gt;
     %end; %else %do;
          &amp;lt;program 2&amp;gt;
      %end;
%mend;
%choose;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 30 Mar 2018 21:29:04 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2018-03-30T21:29:04Z</dc:date>
    <item>
      <title>Run the whole code on the base of condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-the-whole-code-on-the-base-of-condition/m-p/449896#M283654</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to run the code based on certain conditions, lets say if the sex="M" then it will run the whole code&lt;/P&gt;&lt;P&gt;other wise it will run the other codes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my code contain different macros and data step programs and sql quries as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advane&lt;/P&gt;</description>
      <pubDate>Fri, 30 Mar 2018 12:27:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-the-whole-code-on-the-base-of-condition/m-p/449896#M283654</guid>
      <dc:creator>shivamarrora0</dc:creator>
      <dc:date>2018-03-30T12:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: Run the whole code on the base of condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-the-whole-code-on-the-base-of-condition/m-p/449920#M283655</link>
      <description>&lt;P&gt;Does the condition relate to your &lt;STRONG&gt;data&lt;/STRONG&gt; (where=(var=value)) or to&lt;STRONG&gt; external info&lt;/STRONG&gt; (like date of run) ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Mar 2018 13:18:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-the-whole-code-on-the-base-of-condition/m-p/449920#M283655</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-03-30T13:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Run the whole code on the base of condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-the-whole-code-on-the-base-of-condition/m-p/450061#M283656</link>
      <description>it can be either of 1 , what i want is to execute whole code on based on single condition, if the condition is false then i want to execute the other code</description>
      <pubDate>Fri, 30 Mar 2018 20:30:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-the-whole-code-on-the-base-of-condition/m-p/450061#M283656</guid>
      <dc:creator>shivamarrora0</dc:creator>
      <dc:date>2018-03-30T20:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Run the whole code on the base of condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-the-whole-code-on-the-base-of-condition/m-p/450074#M283657</link>
      <description>&lt;P&gt;You can use next skiltom:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro(choose);
     data _null_;
       set any_data;
             if &amp;lt;condition&amp;gt; 
                then call symput('flag',1);
                else call symput('flag',0);
     run;
     
     %if &amp;amp;flag = 1 %then do;
           &amp;lt;program 1&amp;gt;
     %end; %else %do;
          &amp;lt;program 2&amp;gt;
      %end;
%mend;
%choose;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Mar 2018 21:29:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-the-whole-code-on-the-base-of-condition/m-p/450074#M283657</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-03-30T21:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: Run the whole code on the base of condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-the-whole-code-on-the-base-of-condition/m-p/450082#M283658</link>
      <description>&lt;P&gt;Can you show what type of code you are expecting to do this for?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Within a data step is one thing but if you need to do this with multiple procs and such that is another set of potential headaches.&lt;/P&gt;
&lt;P&gt;other code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/144247"&gt;@shivamarrora0&lt;/a&gt; wrote:&lt;BR /&gt;it can be either of 1 , what i want is to execute whole code on based on single condition, if the condition is false then i want to execute the other code&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I am not sure what "either of 1" means in this context. And what is "whole code"? Examples go a long way to clarifying questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Mar 2018 23:03:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-the-whole-code-on-the-base-of-condition/m-p/450082#M283658</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-03-30T23:03:08Z</dc:date>
    </item>
  </channel>
</rss>

