<?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 Interpret text in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Interpret-text/m-p/326661#M72795</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a large dataset with dosage information as text strings. I am coverting these into numerical information.&lt;/P&gt;
&lt;P&gt;Same dosages can be written in many different ways. Is there any way to convert this information to numeric is a "easy" way?&lt;/P&gt;
&lt;P&gt;Example of dosages:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1 tablet 1 times daily&amp;nbsp;&amp;nbsp; (should correspond to the numeric value of 1)&lt;/P&gt;
&lt;P&gt;1 TABLET. 1 TIMES DAILY (should correspond to the numeric value of 1)&lt;/P&gt;
&lt;P&gt;1 TABL. 1 TIME DAILY (should correspond to the numeric value of 1)&lt;/P&gt;
&lt;P&gt;1 tabl daily&amp;nbsp; (should correspond to the numeric value of 1)&lt;/P&gt;
&lt;P&gt;1 TABLET DAILY&amp;nbsp; (should correspond to the numeric value of 1)&lt;/P&gt;
&lt;P&gt;etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you use perl expressions? (No experience on this)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank for any help!&lt;/P&gt;
&lt;P&gt;Thomas&lt;/P&gt;</description>
    <pubDate>Mon, 23 Jan 2017 10:21:09 GMT</pubDate>
    <dc:creator>bollibompa</dc:creator>
    <dc:date>2017-01-23T10:21:09Z</dc:date>
    <item>
      <title>Interpret text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Interpret-text/m-p/326661#M72795</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a large dataset with dosage information as text strings. I am coverting these into numerical information.&lt;/P&gt;
&lt;P&gt;Same dosages can be written in many different ways. Is there any way to convert this information to numeric is a "easy" way?&lt;/P&gt;
&lt;P&gt;Example of dosages:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1 tablet 1 times daily&amp;nbsp;&amp;nbsp; (should correspond to the numeric value of 1)&lt;/P&gt;
&lt;P&gt;1 TABLET. 1 TIMES DAILY (should correspond to the numeric value of 1)&lt;/P&gt;
&lt;P&gt;1 TABL. 1 TIME DAILY (should correspond to the numeric value of 1)&lt;/P&gt;
&lt;P&gt;1 tabl daily&amp;nbsp; (should correspond to the numeric value of 1)&lt;/P&gt;
&lt;P&gt;1 TABLET DAILY&amp;nbsp; (should correspond to the numeric value of 1)&lt;/P&gt;
&lt;P&gt;etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you use perl expressions? (No experience on this)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank for any help!&lt;/P&gt;
&lt;P&gt;Thomas&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 10:21:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Interpret-text/m-p/326661#M72795</guid>
      <dc:creator>bollibompa</dc:creator>
      <dc:date>2017-01-23T10:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Interpret text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Interpret-text/m-p/326666#M72796</link>
      <description>&lt;P&gt;Why is dose information in a text field, that is madness. &amp;nbsp;I would immeidately send it back to source and ask them to fix it. &amp;nbsp;Sure you could try doing some string parsing on the data, but the sheer number of permutations makes it very difficult. &amp;nbsp;Not to mention that some "doses" will require medical input as to what is what. &amp;nbsp;In your example, why does 1 tablet daily = 1? &amp;nbsp;Does it only last one day? &amp;nbsp;If not then dose is not 1 but cumulation of number of days taken. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a good example of why, at database creation, every care should be taken to avoid free text fields.&lt;/P&gt;
&lt;P&gt;If it was me and I had to do this, I would produce a listing of distinct values, send it to the medic/DM, and ask them to provide decodes for each of the values. &amp;nbsp;Then read that file in and code based on responses.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 10:34:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Interpret-text/m-p/326666#M72796</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-01-23T10:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Interpret text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Interpret-text/m-p/326670#M72799</link>
      <description>&lt;P&gt;Thank you RW9!&lt;/P&gt;
&lt;P&gt;I agree that it is of course a bad idea having this information as string. But unfortunately that is how it is stored now. I have manually evaluated all dosages and transformed the into numeric. I am asking now since I would like to evaluate the perfomance of string parsing (or something else) compared to my manual evaluation. In my example 1 tablet daily was corresponding to the daily numeric dose of 1 but it says nothing about the duration of treatment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/Thomas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 10:47:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Interpret-text/m-p/326670#M72799</guid>
      <dc:creator>bollibompa</dc:creator>
      <dc:date>2017-01-23T10:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Interpret text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Interpret-text/m-p/326694#M72810</link>
      <description>&lt;P&gt;I guess you could write code to try to standardize the text (i.e. covert "tabl" to "tablet", and "per day" to "daily").&amp;nbsp; Then parse the standardized code.&amp;nbsp; But I think you should consiider using the results of your&amp;nbsp; manual effort to construct a lookup table, which you can use on new data.&amp;nbsp; That would leave only never-seen-before text to parse (and ultimately add to the lookup table).&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 12:38:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Interpret-text/m-p/326694#M72810</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-01-23T12:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Interpret text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Interpret-text/m-p/326711#M72814</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/29029"&gt;@bollibompa&lt;/a&gt;&amp;nbsp;- you gave only one set of variations - set for tablets per day.&lt;/P&gt;
&lt;P&gt;What other sets of text contents are available ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would work through next steps:&lt;/P&gt;
&lt;P&gt;1) &amp;nbsp;use function lowcase() &amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) &amp;nbsp;use function tranw() to replace variant words into standard keywords&lt;/P&gt;
&lt;P&gt;3) &amp;nbsp;use function findw() or index() to search for the keywords &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; and when found search for numeric amount&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;</description>
      <pubDate>Mon, 23 Jan 2017 13:57:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Interpret-text/m-p/326711#M72814</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-01-23T13:57:10Z</dc:date>
    </item>
  </channel>
</rss>

