<?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: IF THEN in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN/m-p/615719#M180126</link>
    <description>&lt;P&gt;Thank You for the explanation , but I can give the other number ( like 80) instead of 65&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jan 2020 16:37:01 GMT</pubDate>
    <dc:creator>souji</dc:creator>
    <dc:date>2020-01-07T16:37:01Z</dc:date>
    <item>
      <title>IF THEN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN/m-p/615533#M180050</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;　In SAS Prep guide, how it defined id=1147 is age 65 (it could be some # in age)..please explain&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data work.clean_data;&lt;/P&gt;&lt;P&gt;set cert.pats;&lt;/P&gt;&lt;P&gt;gender=upcase(Gender);&lt;/P&gt;&lt;P&gt;if Gender='G' then Gender='M';&lt;/P&gt;&lt;P&gt;if &lt;STRONG&gt;id=1147&lt;/STRONG&gt; then &lt;STRONG&gt;age=65&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;else if&lt;STRONG&gt; id=5277&lt;/STRONG&gt; then &lt;STRONG&gt;age=75&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print data=work.clean_data;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 03:24:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-THEN/m-p/615533#M180050</guid>
      <dc:creator>souji</dc:creator>
      <dc:date>2020-01-07T03:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN/m-p/615535#M180052</link>
      <description>&lt;P&gt;The value of ID comes from your source table cert.pats.&lt;/P&gt;
&lt;P&gt;The code then has a condition which tests the value of ID (if id=1147). If the value of ID coming from your source table is 1147 then the condition becomes true and the bit after THEN gets executed. So here a value of 65 gets assigned to variable age overwriting whatever value age had before. The result gets at the end of the data step written to output table work.clean_data.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 03:57:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-THEN/m-p/615535#M180052</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-01-07T03:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN/m-p/615578#M180060</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301371"&gt;@souji&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please compare the two datasets below (on the left, the initial dataset&amp;nbsp;cert.pats; on the right the new one that has been created):&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Firstly, we ensure that all gender values are in upper case, because we want to replace all "G" by "M". If there was a value like "g", the condition won't apply.&lt;/LI&gt;
&lt;LI&gt;Secondly, for the specific ID value 1147 (age = 116), we want to replace the age by 65 (which is more plausible). The same for id=5277 (age 202 replaced by 75).&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="cert.pats" style="width: 156px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35197i60770BBFE2DE9D87/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture d’écran 2020-01-07 à 08.17.07.png" alt="cert.pats" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;cert.pats&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="work.clean_data" style="width: 157px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35198i0EFB180A37C38F61/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture d’écran 2020-01-07 à 08.17.15.png" alt="work.clean_data" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;work.clean_data&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 07:23:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-THEN/m-p/615578#M180060</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-01-07T07:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN/m-p/615719#M180126</link>
      <description>&lt;P&gt;Thank You for the explanation , but I can give the other number ( like 80) instead of 65&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 16:37:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-THEN/m-p/615719#M180126</guid>
      <dc:creator>souji</dc:creator>
      <dc:date>2020-01-07T16:37:01Z</dc:date>
    </item>
  </channel>
</rss>

