<?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: Using if like then statement in data step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-if-like-then-statement-in-data-step/m-p/485471#M126140</link>
    <description>&lt;P&gt;Whilst you may get an answer to your question, I would ask why you want to do this.&amp;nbsp; I mean if you want to assign 01 to all records with amoxicillin, what about:&lt;BR /&gt;aabbcc amoxicillin def&lt;/P&gt;
&lt;P&gt;or&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;something somwhere is using amoxicillin&lt;/P&gt;
&lt;P&gt;or&amp;nbsp;&lt;/P&gt;
&lt;P&gt;amoxy was used&lt;/P&gt;
&lt;P&gt;or&amp;nbsp;&lt;/P&gt;
&lt;P&gt;trimox&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Drug coding should be done at using an appropriate dictionary, as you can see particularly in the last example, that simple text finding will not necessarily get you all the records (its a brand name for amoxycillin).&lt;/P&gt;</description>
    <pubDate>Thu, 09 Aug 2018 13:44:55 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-08-09T13:44:55Z</dc:date>
    <item>
      <title>Using if like then statement in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-if-like-then-statement-in-data-step/m-p/485455#M126134</link>
      <description>&lt;P&gt;Hi I have this&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA STDTELMT.MERGED_D;&lt;BR /&gt;SET STDTELMT.MERGED_C;&lt;BR /&gt;IF ANTIBIOTIC ="AMOXICILLIN FOR ABSCESSED TOOTH" THEN ANTIBIOT_NAME = "01";&lt;BR /&gt;IF ANTIBIOTIC= "AMOXICILLIN" THEN ANTIBIOT_NAME= "01";&lt;BR /&gt;IF ANTIBIOTIC= "CEFTRIAXONE AND AZITHRO FOR GC" THEN ANTIBIOT_NAME="04";&lt;BR /&gt;IF ANTIBIOTIC= "CIPRO EYE DROPS" THEN ANTIBIOT_NAME="06";&lt;BR /&gt;IF ANTIBIOTIC= "DOXY 200MG 2X DAY X 6 DAYS(OFF STREET)" THEN ANTIBIOT_NAME="09";&lt;BR /&gt;IF ANTIBIOTIC= "DOXYCYCLINE 100 MG BID X 10D 1-3-18" THEN ANTIBIOT_NAME="09";&lt;BR /&gt;IF ANTIBIOTIC= "AZITHROMYCIN FOR NSU TESTED IN MN" THEN ANTIBIOT_NAME="11";&lt;BR /&gt;IF ANTIBIOTIC= "AZITHROMYCIN FOR NSU" THEN ANTIBIOT_NAME="11";&lt;BR /&gt;IF ANTIBIOTIC= "AZITHROMYCIN AND METRONIDAZOLE FOR BV,TRICH,&amp;amp; CT" THEN ANTIBIOT_NAME="11";&lt;BR /&gt;IF ANTIBIOTIC= "AZITHRO FOR NSU; CT + URINE" THEN ANTIBIOT_NAME="11";&lt;BR /&gt;IF ANTIBIOTIC= "AZITHRO FOR MYCOPLASMA GENITALIUM" THEN ANTIBIOT_NAME="11";&lt;BR /&gt;IF ANTIBIOTIC= "AZITHRO FOR CT" THEN ANTIBIOT_NAME="11";&lt;BR /&gt;IF ANTIBIOTIC = "AZITHRO FOR +CT RECTUM" THEN ANTIBIOT_NAME = "11";&lt;BR /&gt;IF ANTIBIOTIC= "AZ/CEFTRIAXONE" THEN ANTIBIOT_NAME="11";&lt;BR /&gt;IF ANTIBIOTIC= "LEVOFLOXICIN/VALCYCLOVIR SINCE 1/2" THEN ANTIBIOT_NAME="22";&lt;BR /&gt;IF ANTIBIOTIC= "BICILLIN 2.4 MU IM AT ST.FRANCIS ED" THEN ANTIBIOT_NAME="31";&lt;BR /&gt;IF ANTIBIOTIC= "MULTIPLE ANTIBIOTICS" THEN ANTIBIOT_NAME="77";&lt;BR /&gt;IF ANTIBIOTIC= "METRONIDAZOLE GEL FOR BV" THEN ANTIBIOT_NAME="77";&lt;BR /&gt;IF ANTIBIOTIC= "METRONIDAZOLE FOR BV AT PPWI" THEN ANTIBIOT_NAME="77";&lt;BR /&gt;IF ANTIBIOTIC= "METRONIDAZOLE FOR BV" THEN ANTIBIOT_NAME="77";&lt;BR /&gt;IF ANTIBIOTIC= "FLUCONAZOLE FOR YEAST INFECTION" THEN ANTIBIOT_NAME="77";&lt;BR /&gt;IF ANTIBIOTIC= "CLINDAMYCIN FOR TOOTH ABSCESS" THEN ANTIBIOT_NAME="77";&lt;BR /&gt;IF ANTIBIOTIC= "CLINDAMYCIN" THEN ANTIBIOT_NAME="77";&lt;BR /&gt;IF ANTIBIOTIC= "BACTRIM" THEN ANTIBIOT_NAME="77";&lt;BR /&gt;IF ANTIBIOTIC= "3 WEEKS AGO" THEN ANTIBIOT_NAME="99";&lt;BR /&gt;IF ANTIBIOTIC= "SEE NOTE" THEN ANTIBIOT_NAME="99";&lt;BR /&gt;IF ANTIBIOTIC= "9" THEN ANTIBIOT_NAME="99";&lt;BR /&gt;IF ANTIBIOTIC= "0" THEN ANTIBIOT_NAME="00";&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;How can i create a new variable antibiot_name using some ting like this; if antibiotic like "am%" or "Az%" then antibiot_name=1&lt;/P&gt;&lt;P&gt;&amp;nbsp;how can i use less code?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 13:07:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-if-like-then-statement-in-data-step/m-p/485455#M126134</guid>
      <dc:creator>Dhana18</dc:creator>
      <dc:date>2018-08-09T13:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using if like then statement in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-if-like-then-statement-in-data-step/m-p/485460#M126137</link>
      <description>&lt;P&gt;The colon indicates that you want to see if the variable begins with the letters am or az&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if upcase(antibiotic) =: "AM" or upcase(antibiotic) =: "AZ" then antibiot_name = 1;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Aug 2018 13:13:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-if-like-then-statement-in-data-step/m-p/485460#M126137</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-09T13:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using if like then statement in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-if-like-then-statement-in-data-step/m-p/485471#M126140</link>
      <description>&lt;P&gt;Whilst you may get an answer to your question, I would ask why you want to do this.&amp;nbsp; I mean if you want to assign 01 to all records with amoxicillin, what about:&lt;BR /&gt;aabbcc amoxicillin def&lt;/P&gt;
&lt;P&gt;or&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;something somwhere is using amoxicillin&lt;/P&gt;
&lt;P&gt;or&amp;nbsp;&lt;/P&gt;
&lt;P&gt;amoxy was used&lt;/P&gt;
&lt;P&gt;or&amp;nbsp;&lt;/P&gt;
&lt;P&gt;trimox&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Drug coding should be done at using an appropriate dictionary, as you can see particularly in the last example, that simple text finding will not necessarily get you all the records (its a brand name for amoxycillin).&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 13:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-if-like-then-statement-in-data-step/m-p/485471#M126140</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-08-09T13:44:55Z</dc:date>
    </item>
  </channel>
</rss>

