<?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: Extracting data from differing values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Extracting-data-from-differing-values/m-p/860723#M340005</link>
    <description>&lt;P&gt;You should be able to just let SCAN() do that for you by telling it to use both ( and comma as delimiters.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;test1 = scan(test, 1, "(,");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The only problem would if you want to convert&lt;/P&gt;
&lt;PRE&gt;This has, comma, and (parentheses) in it.&lt;/PRE&gt;
&lt;P&gt;to the longer string&lt;/P&gt;
&lt;PRE&gt;This has, comma, and&lt;/PRE&gt;
&lt;P&gt;instead of just&lt;/P&gt;
&lt;PRE&gt;This has&lt;/PRE&gt;</description>
    <pubDate>Fri, 24 Feb 2023 17:41:57 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-02-24T17:41:57Z</dc:date>
    <item>
      <title>Extracting data from differing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-data-from-differing-values/m-p/860716#M340003</link>
      <description>&lt;P&gt;Hello, I have data values that look like this for column &lt;EM&gt;test&lt;/EM&gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Copper (mg/kg), DM Basis&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Total Digestible Nutrients, %, DM Basis&lt;/P&gt;&lt;P&gt;I need to get the string before the "(" or if it doesn't have that character, the string before the ","&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I've tried this and it hasn't&amp;nbsp;worked&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if test contains "(" then test1 = scan(test, 1, "(");&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else if test contains "," then test1 = scan(test, 1, ",");&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 17:12:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-data-from-differing-values/m-p/860716#M340003</guid>
      <dc:creator>jmmedina252</dc:creator>
      <dc:date>2023-02-24T17:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting data from differing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-data-from-differing-values/m-p/860719#M340004</link>
      <description>&lt;P&gt;To search for a specific character, use the INDEXC function. The data step language does not have a CONTAINS operator.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 17:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-data-from-differing-values/m-p/860719#M340004</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-02-24T17:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting data from differing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-data-from-differing-values/m-p/860723#M340005</link>
      <description>&lt;P&gt;You should be able to just let SCAN() do that for you by telling it to use both ( and comma as delimiters.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;test1 = scan(test, 1, "(,");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The only problem would if you want to convert&lt;/P&gt;
&lt;PRE&gt;This has, comma, and (parentheses) in it.&lt;/PRE&gt;
&lt;P&gt;to the longer string&lt;/P&gt;
&lt;PRE&gt;This has, comma, and&lt;/PRE&gt;
&lt;P&gt;instead of just&lt;/P&gt;
&lt;PRE&gt;This has&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Feb 2023 17:41:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-data-from-differing-values/m-p/860723#M340005</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-02-24T17:41:57Z</dc:date>
    </item>
  </channel>
</rss>

