<?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: Data Step Multiple If's in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Multiple-If-s/m-p/249732#M47000</link>
    <description>&lt;P&gt;The statement IF OK1; is a subsetting if, meaning that output will meet that requirement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Order of most statements in the code is very important. In your example the effect of&lt;/P&gt;
&lt;P&gt;if the_dt eq . then the_dt=tar_dt;&lt;/P&gt;
&lt;P&gt;would not matter as long as it appears between the MERGE (which apparently brings in the values for the variable the_dt) and&lt;/P&gt;
&lt;P&gt;the&lt;STRONG&gt; if the_dt lt date()-21; &lt;/STRONG&gt;where the newly assigned value would be used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Feb 2016 16:29:06 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-02-12T16:29:06Z</dc:date>
    <item>
      <title>Data Step Multiple If's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Multiple-If-s/m-p/249725#M46998</link>
      <description>&lt;P&gt;Where online can i see an explaination of how multiple IF's are handled like below.&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;   data base(keep =  proposal_nbr tar_file tar_dt the_dt);
      merge base(in=ok1) prop_list(in=ok2);
         by proposal_nbr;
      if ok1;
      if the_dt eq . then the_dt=tar_dt;
      if the_dt lt date()-21;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The first one "gates" if an output is created, so if it misses, the last IF gets a chance to create an output?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Is that the proper way to look at this?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also, does it matter that the line "the_dt=tar_dt" isn't higher up in the code?? Does it only take-effect from that point downward?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 16:20:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Multiple-If-s/m-p/249725#M46998</guid>
      <dc:creator>cellurl</dc:creator>
      <dc:date>2016-02-12T16:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step Multiple If's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Multiple-If-s/m-p/249732#M47000</link>
      <description>&lt;P&gt;The statement IF OK1; is a subsetting if, meaning that output will meet that requirement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Order of most statements in the code is very important. In your example the effect of&lt;/P&gt;
&lt;P&gt;if the_dt eq . then the_dt=tar_dt;&lt;/P&gt;
&lt;P&gt;would not matter as long as it appears between the MERGE (which apparently brings in the values for the variable the_dt) and&lt;/P&gt;
&lt;P&gt;the&lt;STRONG&gt; if the_dt lt date()-21; &lt;/STRONG&gt;where the newly assigned value would be used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 16:29:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Multiple-If-s/m-p/249732#M47000</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-02-12T16:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step Multiple If's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Multiple-If-s/m-p/249758#M47011</link>
      <description>&lt;P&gt;so what would this do?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data out;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;set in;&lt;/P&gt;
&lt;P&gt;if a;&lt;/P&gt;
&lt;P&gt;if b;&lt;/P&gt;
&lt;P&gt;if c;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this the same as "if a and b and c" then output?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 17:11:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Multiple-If-s/m-p/249758#M47011</guid>
      <dc:creator>cellurl</dc:creator>
      <dc:date>2016-02-12T17:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step Multiple If's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Multiple-If-s/m-p/249767#M47017</link>
      <description>&lt;P&gt;Yes.&lt;/P&gt;
&lt;P&gt;You just need to read about&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000201978.htm" target="_self"&gt;&amp;nbsp;IF Statement, Subsetting&lt;/A&gt;, and understand what it is equivalent to.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 17:38:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Multiple-If-s/m-p/249767#M47017</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-02-12T17:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step Multiple If's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Multiple-If-s/m-p/249806#M47036</link>
      <description>&lt;P&gt;And regarding using "subsetting if" with "Merge" statment and how that work. Check &amp;nbsp;"ONE-TO-ONE MATCH-MERGE KEEPING SOME OBSERVATIONS " in this paper &lt;A href="http://www.lexjansen.com/nesug/nesug11/ds/ds03.pdf" target="_self"&gt;SAS® DATA Step Merge – A Powerful Tool&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 19:46:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Multiple-If-s/m-p/249806#M47036</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-02-12T19:46:11Z</dc:date>
    </item>
  </channel>
</rss>

