<?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 Handling /manipulating text /character values in  Base SAS 9.4 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Handling-manipulating-text-character-values-in-Base-SAS-9-4/m-p/791524#M253548</link>
    <description>&lt;P&gt;Hi Experts,&lt;BR /&gt;In a SAS table, I have a variable (character) that has text/character values in it. I need to create new variables and supply values to them based on an already existing column's available values. For example: &lt;BR /&gt;A column named COMMENT that has values( in multiple rows: comment1, comment2, comment3 etc.) everything under the sun like: comment1_value- Strictly follow the guidelines. Refrain from generalization. Oral use only.&lt;BR /&gt;comment2_value: Oral use only. Manufacturer not responsible for any mishaps.comment3_value: Available in NC &amp;lt;state&amp;gt; only.comment4-value: Product type= non invasive, hypodermic use only. comment5_value: Use if only confident.&lt;BR /&gt;comment6_value: Oral or usp: EVER oral unless otherwise noted.comment7_value: Oral only.Chk brochure, refer to point #9.comment8_value:Usage type: oral only. comment9_value:Invasive, IV use.&lt;/P&gt;
&lt;P&gt;So now I need to return columns like these:&lt;BR /&gt;1.usage_mode and supply 'oral' as its value excluding other words (source- comment1_value: Strictly follow the guidelines. Refrain from generalization.Oral use only)&lt;BR /&gt;2.where_available and supply 'NC' as its value(source- comment3_value: Available in NC &amp;lt;state&amp;gt; only)&lt;BR /&gt;3.usage_type and supply 'usp' as its value (source-comment6_value: Oral or usp: EVER oral unless otherwise noted.)&lt;BR /&gt;4.product_type and supply 'IV use' as its value (source_ comment9_value:Invasive, IV use.)&lt;BR /&gt;and the list goes on &lt;BR /&gt;The only common thing is I need to search for relevant words from the available info (in the preceding/following column-in the same row) and extract relevant words/phrases/values and supply values to the adjacent rows under the newly created&amp;nbsp; columns.&lt;BR /&gt;Can you please share any helpful links to any character functions(text mining) in SAS (and/or proc sql) other than scan function? &lt;BR /&gt;Thanks for your assistance in advance.&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jan 2022 17:35:35 GMT</pubDate>
    <dc:creator>inquistive</dc:creator>
    <dc:date>2022-01-21T17:35:35Z</dc:date>
    <item>
      <title>Handling /manipulating text /character values in  Base SAS 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-manipulating-text-character-values-in-Base-SAS-9-4/m-p/791524#M253548</link>
      <description>&lt;P&gt;Hi Experts,&lt;BR /&gt;In a SAS table, I have a variable (character) that has text/character values in it. I need to create new variables and supply values to them based on an already existing column's available values. For example: &lt;BR /&gt;A column named COMMENT that has values( in multiple rows: comment1, comment2, comment3 etc.) everything under the sun like: comment1_value- Strictly follow the guidelines. Refrain from generalization. Oral use only.&lt;BR /&gt;comment2_value: Oral use only. Manufacturer not responsible for any mishaps.comment3_value: Available in NC &amp;lt;state&amp;gt; only.comment4-value: Product type= non invasive, hypodermic use only. comment5_value: Use if only confident.&lt;BR /&gt;comment6_value: Oral or usp: EVER oral unless otherwise noted.comment7_value: Oral only.Chk brochure, refer to point #9.comment8_value:Usage type: oral only. comment9_value:Invasive, IV use.&lt;/P&gt;
&lt;P&gt;So now I need to return columns like these:&lt;BR /&gt;1.usage_mode and supply 'oral' as its value excluding other words (source- comment1_value: Strictly follow the guidelines. Refrain from generalization.Oral use only)&lt;BR /&gt;2.where_available and supply 'NC' as its value(source- comment3_value: Available in NC &amp;lt;state&amp;gt; only)&lt;BR /&gt;3.usage_type and supply 'usp' as its value (source-comment6_value: Oral or usp: EVER oral unless otherwise noted.)&lt;BR /&gt;4.product_type and supply 'IV use' as its value (source_ comment9_value:Invasive, IV use.)&lt;BR /&gt;and the list goes on &lt;BR /&gt;The only common thing is I need to search for relevant words from the available info (in the preceding/following column-in the same row) and extract relevant words/phrases/values and supply values to the adjacent rows under the newly created&amp;nbsp; columns.&lt;BR /&gt;Can you please share any helpful links to any character functions(text mining) in SAS (and/or proc sql) other than scan function? &lt;BR /&gt;Thanks for your assistance in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 17:35:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-manipulating-text-character-values-in-Base-SAS-9-4/m-p/791524#M253548</guid>
      <dc:creator>inquistive</dc:creator>
      <dc:date>2022-01-21T17:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Handling /manipulating text /character values in  Base SAS 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-manipulating-text-character-values-in-Base-SAS-9-4/m-p/791544#M253555</link>
      <description>&lt;P&gt;In a SAS data set this basically meaningless: "A column named COMMENT that has values( in multiple rows:"&lt;/P&gt;
&lt;P&gt;A SAS variable exists on a single observation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One suspects the source of this data but If you are reading a TEXT file of some sort you might provide that instead of this rambling description. This sort of thing is often better (and sometimes easier) addressed when reading the data.&lt;/P&gt;
&lt;P&gt;Basically without an actual example of your data we can't provide much help (yet).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;/&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe, the sort of stuff you describe may not handle conversion to a data step well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 17:59:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-manipulating-text-character-values-in-Base-SAS-9-4/m-p/791544#M253555</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-01-21T17:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Handling /manipulating text /character values in  Base SAS 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-manipulating-text-character-values-in-Base-SAS-9-4/m-p/791556#M253566</link>
      <description>&lt;P&gt;A better way to search text: Perl regular expressions in SAS&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings11/006-2011.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings11/006-2011.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Skim all character functions:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n01f5qrjoh9h4hn1olbdpb5pr2td.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n01f5qrjoh9h4hn1olbdpb5pr2td.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A simple approach to text analysis using SAS functions&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2018/2557-2018.pdf" target="_blank"&gt;https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2018/2557-2018.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/83652"&gt;@inquistive&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Experts,&lt;BR /&gt;In a SAS table, I have a variable (character) that has text/character values in it. I need to create new variables and supply values to them based on an already existing column's available values. For example: &lt;BR /&gt;A column named COMMENT that has values( in multiple rows: comment1, comment2, comment3 etc.) everything under the sun like: comment1_value- Strictly follow the guidelines. Refrain from generalization. Oral use only.&lt;BR /&gt;comment2_value: Oral use only. Manufacturer not responsible for any mishaps.comment3_value: Available in NC &amp;lt;state&amp;gt; only.comment4-value: Product type= non invasive, hypodermic use only. comment5_value: Use if only confident.&lt;BR /&gt;comment6_value: Oral or usp: EVER oral unless otherwise noted.comment7_value: Oral only.Chk brochure, refer to point #9.comment8_value:Usage type: oral only. comment9_value:Invasive, IV use.&lt;/P&gt;
&lt;P&gt;So now I need to return columns like these:&lt;BR /&gt;1.usage_mode and supply 'oral' as its value excluding other words (source- comment1_value: Strictly follow the guidelines. Refrain from generalization.Oral use only)&lt;BR /&gt;2.where_available and supply 'NC' as its value(source- comment3_value: Available in NC &amp;lt;state&amp;gt; only)&lt;BR /&gt;3.usage_type and supply 'usp' as its value (source-comment6_value: Oral or usp: EVER oral unless otherwise noted.)&lt;BR /&gt;4.product_type and supply 'IV use' as its value (source_ comment9_value:Invasive, IV use.)&lt;BR /&gt;and the list goes on &lt;BR /&gt;The only common thing is I need to search for relevant words from the available info (in the preceding/following column-in the same row) and extract relevant words/phrases/values and supply values to the adjacent rows under the newly created&amp;nbsp; columns.&lt;BR /&gt;Can you please share any helpful links to any character functions(text mining) in SAS (and/or proc sql) other than scan function? &lt;BR /&gt;Thanks for your assistance in advance.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 18:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-manipulating-text-character-values-in-Base-SAS-9-4/m-p/791556#M253566</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-01-21T18:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Handling /manipulating text /character values in  Base SAS 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-manipulating-text-character-values-in-Base-SAS-9-4/m-p/791570#M253578</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Thanks for the suggestion.&lt;/P&gt;
&lt;P&gt;I am sorry for the ramblings. I am looking for suggestions on what functions could be employed. I have limited knowledge of scan and tranwrd&amp;nbsp; functions, which&amp;nbsp; I don't believe, are sufficient in this case. Or it may be my&amp;nbsp; ignorance.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 19:02:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-manipulating-text-character-values-in-Base-SAS-9-4/m-p/791570#M253578</guid>
      <dc:creator>inquistive</dc:creator>
      <dc:date>2022-01-21T19:02:08Z</dc:date>
    </item>
  </channel>
</rss>

