<?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 statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/if-then-statement/m-p/554856#M154385</link>
    <description>&lt;P&gt;Thank you. I modified the&amp;nbsp; like this and it worked.&lt;/P&gt;&lt;P&gt;DATA MarchNin.MERGE_March2019_P;&lt;BR /&gt;SET MarchNin.MERGE_March2019_O;&lt;BR /&gt;IF HIV_COMBON_A="P" THEN GISP_HIVRESULT ="1";&lt;BR /&gt;else IF HIV_COMBON_A ="N" OR HIV_1_2_ABBLOOD ="N" OR HIV_GEENION_A="N" OR HIV_PCRN_A="N" THEN GISP_HIVRESULT ="0";&lt;BR /&gt;ELSE IF HIV_COMBON_A ="A" OR HIV_1_2_ABBLOOD ="A" OR HIV_GEENION_A="A" OR HIV_PCRN_A="A" THEN GISP_HIVRESULT ="9";&lt;BR /&gt;ELSE GISP_HIVRESULT ="7";&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;I did not have response "P" in all variables.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Apr 2019 21:15:37 GMT</pubDate>
    <dc:creator>Dhana18</dc:creator>
    <dc:date>2019-04-29T21:15:37Z</dc:date>
    <item>
      <title>if then statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-then-statement/m-p/554845#M154381</link>
      <description>&lt;P&gt;Pleasse tell me what is wrong with this code?&lt;/P&gt;&lt;P&gt;DATA MarchNin.MERGE_March2019_P;&lt;BR /&gt;SET MarchNin.MERGE_March2019_O;&lt;BR /&gt;IF HIV_COMBON_A ="N" OR HIV_1_2_ABBLOOD ="N" OR HIV_GEENION_A="N" OR HIV_PCRN_A="N" THEN GISP_HIVRESULT ="0";&lt;BR /&gt;ELSE IF HIV_COMBON_A ="A" OR HIV_1_2_ABBLOOD ="A" OR HIV_GEENION_A="A" OR HIV_PCRN_A="A" THEN GISP_HIVRESULT ="9";&lt;BR /&gt;ELSE IF HIV_COMBON_A="P" OR HIV_1_2_ABBLOOD="P" OR HIV_GEENION_A="P" OR HIV_PCRN_A="P" THEN GISP_HIVRESULT ="1";&lt;BR /&gt;ELSE GISP_HIVRESULT ="7";&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;PROC FREQ DATA=MarchNin.MERGE_March2019_P;&lt;BR /&gt;TABLE GISP_HIVRESULT;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the result:&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;GISP_HIVRESULT Frequency Percent CumulativeFrequency CumulativePercent079 &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;241&lt;/TD&gt;&lt;TD&gt;64.61&lt;/TD&gt;&lt;TD&gt;241&lt;/TD&gt;&lt;TD&gt;64.61&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;128&lt;/TD&gt;&lt;TD&gt;34.32&lt;/TD&gt;&lt;TD&gt;369&lt;/TD&gt;&lt;TD&gt;98.93&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;1.07&lt;/TD&gt;&lt;TD&gt;373&lt;/TD&gt;&lt;TD&gt;100.00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;Why am I not getting only 0, 7, and 9 and not 1 under&amp;nbsp;GISP_HIVRESULT?&amp;nbsp; Please help.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 29 Apr 2019 20:19:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-then-statement/m-p/554845#M154381</guid>
      <dc:creator>Dhana18</dc:creator>
      <dc:date>2019-04-29T20:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: if then statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-then-statement/m-p/554854#M154384</link>
      <description>&lt;P&gt;Proc freq only presents to you the frequencies that occur in your data. It does not include zeros for values that could have been present but that didn't occur in your data.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2019 21:04:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-then-statement/m-p/554854#M154384</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-04-29T21:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: if then statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-then-statement/m-p/554856#M154385</link>
      <description>&lt;P&gt;Thank you. I modified the&amp;nbsp; like this and it worked.&lt;/P&gt;&lt;P&gt;DATA MarchNin.MERGE_March2019_P;&lt;BR /&gt;SET MarchNin.MERGE_March2019_O;&lt;BR /&gt;IF HIV_COMBON_A="P" THEN GISP_HIVRESULT ="1";&lt;BR /&gt;else IF HIV_COMBON_A ="N" OR HIV_1_2_ABBLOOD ="N" OR HIV_GEENION_A="N" OR HIV_PCRN_A="N" THEN GISP_HIVRESULT ="0";&lt;BR /&gt;ELSE IF HIV_COMBON_A ="A" OR HIV_1_2_ABBLOOD ="A" OR HIV_GEENION_A="A" OR HIV_PCRN_A="A" THEN GISP_HIVRESULT ="9";&lt;BR /&gt;ELSE GISP_HIVRESULT ="7";&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;I did not have response "P" in all variables.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2019 21:15:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-then-statement/m-p/554856#M154385</guid>
      <dc:creator>Dhana18</dc:creator>
      <dc:date>2019-04-29T21:15:37Z</dc:date>
    </item>
  </channel>
</rss>

