<?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 from a string with multiple values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Extracting-from-a-string-with-multiple-values/m-p/639809#M190406</link>
    <description>&lt;PRE&gt;data _null_;
x="C60.182, C29.4, C30.1";
y=prxchange('s/\.\d+/ /',-1, x);
put y=;
run;

&amp;gt;&amp;gt;&amp;gt;LOG: y=C60, C29, C30 

data want;
set have;
y=prxchange('s/\.\d+/ /',-1, ICD_Code);
run;&lt;/PRE&gt;&lt;P&gt;Hope can help you&lt;/P&gt;</description>
    <pubDate>Tue, 14 Apr 2020 15:55:46 GMT</pubDate>
    <dc:creator>kelxxx</dc:creator>
    <dc:date>2020-04-14T15:55:46Z</dc:date>
    <item>
      <title>Extracting from a string with multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-from-a-string-with-multiple-values/m-p/639806#M190404</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have a variable with ICD codes. I want everything of the left of the decimal. But some cells have multiple codes in a row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="179"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="85.6px"&gt;ICD_Code&lt;/TD&gt;
&lt;TD width="95.2px"&gt;ICD_Code1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="85.6px"&gt;C18.9&lt;/TD&gt;
&lt;TD width="95.2px"&gt;C18&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="85.6px"&gt;C15.9&lt;/TD&gt;
&lt;TD width="95.2px"&gt;C15&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="85.6px"&gt;Z80.3&lt;/TD&gt;
&lt;TD width="95.2px"&gt;Z80&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="85.6px"&gt;Z12.11, Z12.12&lt;/TD&gt;
&lt;TD width="95.2px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="85.6px"&gt;Z85.46&lt;/TD&gt;
&lt;TD width="95.2px"&gt;Z85&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="85.6px"&gt;Z85.528&lt;/TD&gt;
&lt;TD width="95.2px"&gt;Z85&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="85.6px"&gt;C65.9, C66.9&lt;/TD&gt;
&lt;TD width="95.2px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code was as following:&lt;/P&gt;
&lt;P&gt;if&amp;nbsp; ICD_Code1 in ("C85","C50",&amp;nbsp; &amp;nbsp;~~ a lot more codes~~ )&amp;nbsp;then Cancer=1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also tried with scan and substr, but I don't know how to do it when there are many values separated by commas.&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 15:39:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-from-a-string-with-multiple-values/m-p/639806#M190404</guid>
      <dc:creator>Xinxin</dc:creator>
      <dc:date>2020-04-14T15:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting from a string with multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-from-a-string-with-multiple-values/m-p/639809#M190406</link>
      <description>&lt;PRE&gt;data _null_;
x="C60.182, C29.4, C30.1";
y=prxchange('s/\.\d+/ /',-1, x);
put y=;
run;

&amp;gt;&amp;gt;&amp;gt;LOG: y=C60, C29, C30 

data want;
set have;
y=prxchange('s/\.\d+/ /',-1, ICD_Code);
run;&lt;/PRE&gt;&lt;P&gt;Hope can help you&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 15:55:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-from-a-string-with-multiple-values/m-p/639809#M190406</guid>
      <dc:creator>kelxxx</dc:creator>
      <dc:date>2020-04-14T15:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting from a string with multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-from-a-string-with-multiple-values/m-p/639838#M190411</link>
      <description>Thank you...that worked and I learnt something new!!</description>
      <pubDate>Tue, 14 Apr 2020 17:01:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-from-a-string-with-multiple-values/m-p/639838#M190411</guid>
      <dc:creator>Xinxin</dc:creator>
      <dc:date>2020-04-14T17:01:49Z</dc:date>
    </item>
  </channel>
</rss>

