<?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 wildcards for where and if in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/wildcards-for-where-and-if/m-p/470982#M120580</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a table of drugs, and i need to update the generic name for each drugs.&lt;/P&gt;&lt;P&gt;for example:&lt;/P&gt;&lt;P&gt;Colum1 (Drug)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Column2(Generic name)&amp;nbsp;&lt;/P&gt;&lt;P&gt;RECLIMET&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Metformin&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (-----&amp;gt; i do have update 'METFORMIN' in Col2)&lt;/P&gt;&lt;P&gt;........&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .......&lt;/P&gt;&lt;P&gt;Reclument&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .......&lt;/P&gt;&lt;P&gt;Relument&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my table most of drugs have are typo error. like RECLIMET as RECLUMRT/RELIMET&amp;nbsp; but i should find all those and update the correct name in Column2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried with some stuffs like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;update table_name&lt;/P&gt;&lt;P&gt;set Column2 = 'METFORMIN'&lt;BR /&gt;where ddrug11 =* 'RECLIMET';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;update table_name&lt;/P&gt;&lt;P&gt;set Column2 = 'ASPIRIN'&lt;BR /&gt;where ddrug11 =* 'ECOSPRIN';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IS IT RIGHT?&lt;/P&gt;&lt;P&gt;----IF IT IS RIGHT IN THE SENSE, HOW SHOULD I UPDATE FOR ALL 1000 OF DRUGS&amp;nbsp;&lt;/P&gt;&lt;P&gt;----IF IT IS WRONG GIVE ME A SOLUTION.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the whole how could i solve all. Is there any way to come across this problem using macro or something else.&lt;/P&gt;&lt;P&gt;Even if u solve it in simple data steps are also fine for me.&lt;/P&gt;&lt;P&gt;What ever the method it is... Please suggest me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help to resolve this.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jun 2018 08:16:33 GMT</pubDate>
    <dc:creator>Sathish_jammy</dc:creator>
    <dc:date>2018-06-18T08:16:33Z</dc:date>
    <item>
      <title>wildcards for where and if</title>
      <link>https://communities.sas.com/t5/SAS-Programming/wildcards-for-where-and-if/m-p/470982#M120580</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a table of drugs, and i need to update the generic name for each drugs.&lt;/P&gt;&lt;P&gt;for example:&lt;/P&gt;&lt;P&gt;Colum1 (Drug)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Column2(Generic name)&amp;nbsp;&lt;/P&gt;&lt;P&gt;RECLIMET&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Metformin&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (-----&amp;gt; i do have update 'METFORMIN' in Col2)&lt;/P&gt;&lt;P&gt;........&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .......&lt;/P&gt;&lt;P&gt;Reclument&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .......&lt;/P&gt;&lt;P&gt;Relument&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my table most of drugs have are typo error. like RECLIMET as RECLUMRT/RELIMET&amp;nbsp; but i should find all those and update the correct name in Column2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried with some stuffs like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;update table_name&lt;/P&gt;&lt;P&gt;set Column2 = 'METFORMIN'&lt;BR /&gt;where ddrug11 =* 'RECLIMET';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;update table_name&lt;/P&gt;&lt;P&gt;set Column2 = 'ASPIRIN'&lt;BR /&gt;where ddrug11 =* 'ECOSPRIN';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IS IT RIGHT?&lt;/P&gt;&lt;P&gt;----IF IT IS RIGHT IN THE SENSE, HOW SHOULD I UPDATE FOR ALL 1000 OF DRUGS&amp;nbsp;&lt;/P&gt;&lt;P&gt;----IF IT IS WRONG GIVE ME A SOLUTION.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the whole how could i solve all. Is there any way to come across this problem using macro or something else.&lt;/P&gt;&lt;P&gt;Even if u solve it in simple data steps are also fine for me.&lt;/P&gt;&lt;P&gt;What ever the method it is... Please suggest me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help to resolve this.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 08:16:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/wildcards-for-where-and-if/m-p/470982#M120580</guid>
      <dc:creator>Sathish_jammy</dc:creator>
      <dc:date>2018-06-18T08:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: wildcards for where and if</title>
      <link>https://communities.sas.com/t5/SAS-Programming/wildcards-for-where-and-if/m-p/470988#M120584</link>
      <description>&lt;P&gt;This is drug coding.&amp;nbsp; It is normally coded within the database or other tool by a specialist coder armed with coding libraries.&amp;nbsp; It is really not a good idea for you to start doing this, you may think think the names are the same, but they may not be based on many different factors.&amp;nbsp; Anyways, your risk, I wouldn't be doing it.&amp;nbsp; If you have to do it, the most efficient way is to have the coding libraries - get the WHO-Drug Dictionary:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://en.wikipedia.org/wiki/WHO_Drug_Dictionary" target="_blank"&gt;https://en.wikipedia.org/wiki/WHO_Drug_Dictionary&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;then merge that onto your data.&amp;nbsp; You will need to apply some manual review where there are non-matches.&lt;/P&gt;
&lt;P&gt;In response to the shouting: "&lt;SPAN&gt;IS IT RIGHT? IF IT IS RIGHT IN THE SENSE, THIS IS HOW SHOULD I UPDATE FOR ALL 1000 OF DRUGS "&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The answer is NO ITS NOT THE RIGHT WAY, see above.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;To this question:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;"I just want to know which method is more effective wildcards in IF or WHERE&lt;/P&gt;
&lt;P&gt;NOTE : not only in IF and WHERE, Is there any other method please let me know."&lt;/P&gt;
&lt;P&gt;It depends on the scenario.&amp;nbsp; If does not work in SQL for instance.&amp;nbsp; What would be a better idea is to get a distinct list of values from your data, then apply some review to the smaller dataset, and set each medication correctly, then use this to merge back to your data - i.e. what you would do with the dictionary above.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 07:52:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/wildcards-for-where-and-if/m-p/470988#M120584</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-18T07:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: wildcards for where and if</title>
      <link>https://communities.sas.com/t5/SAS-Programming/wildcards-for-where-and-if/m-p/470989#M120585</link>
      <description>&lt;P&gt;Start by creating a dataset that contains wrong and correct names:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data control;
input wrong :$20. right :$20.;
cards;
RECLIMET Metformin
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then use that to dynamically write a data step that does all the corrections in one pass:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set control end=eof;
if _n_ = 1 then call execute('data want; set have;');
call execute('if ddrug11 = "' !! strip(wrong) !! '" then column2 = "' !! strip(right) !! '";');
if eof then call execute('run;');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;After that, you only need to expand the control dataset with new wrong/right pairs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit:&lt;/P&gt;
&lt;P&gt;As an alternative, create a format from your wrong/right pairs, and apply that in a single put() function call.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 07:56:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/wildcards-for-where-and-if/m-p/470989#M120585</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-18T07:56:05Z</dc:date>
    </item>
  </channel>
</rss>

