<?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 Splitting Text into different variables in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Splitting-Text-into-different-variables/m-p/461058#M70331</link>
    <description>&lt;P&gt;Greetings Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following variable that does not contain a delimiter. It can be as each of the following combinations, and there are infinity combinations:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;&lt;FONT color="#000000"&gt;Variable1&lt;/FONT&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;123456789&lt;/P&gt;&lt;P&gt;123456789CLOSED&lt;/P&gt;&lt;P&gt;123456-P&lt;/P&gt;&lt;P&gt;123456-PCLOSED&lt;/P&gt;&lt;P&gt;123456&lt;/P&gt;&lt;P&gt;123456CLOSED&lt;/P&gt;&lt;P&gt;987654321&lt;/P&gt;&lt;P&gt;25648985&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Whenever there is an&amp;nbsp;observation&amp;nbsp;that ends with CLOSED, then there must&amp;nbsp;be another&amp;nbsp;observation without&amp;nbsp;CLOSED at the end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Altijani&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 May 2018 17:05:32 GMT</pubDate>
    <dc:creator>altijani</dc:creator>
    <dc:date>2018-05-09T17:05:32Z</dc:date>
    <item>
      <title>Splitting Text into different variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Splitting-Text-into-different-variables/m-p/461058#M70331</link>
      <description>&lt;P&gt;Greetings Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following variable that does not contain a delimiter. It can be as each of the following combinations, and there are infinity combinations:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;&lt;FONT color="#000000"&gt;Variable1&lt;/FONT&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;123456789&lt;/P&gt;&lt;P&gt;123456789CLOSED&lt;/P&gt;&lt;P&gt;123456-P&lt;/P&gt;&lt;P&gt;123456-PCLOSED&lt;/P&gt;&lt;P&gt;123456&lt;/P&gt;&lt;P&gt;123456CLOSED&lt;/P&gt;&lt;P&gt;987654321&lt;/P&gt;&lt;P&gt;25648985&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Whenever there is an&amp;nbsp;observation&amp;nbsp;that ends with CLOSED, then there must&amp;nbsp;be another&amp;nbsp;observation without&amp;nbsp;CLOSED at the end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Altijani&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 17:05:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Splitting-Text-into-different-variables/m-p/461058#M70331</guid>
      <dc:creator>altijani</dc:creator>
      <dc:date>2018-05-09T17:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting Text into different variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Splitting-Text-into-different-variables/m-p/461067#M70332</link>
      <description>&lt;P&gt;UNTESTED CODE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    where_closed = find(variable1,'closed','i');
    if where_closed&amp;gt;0 then id=substr(variable1,1,where_closed-1);
    else id=variable1;
run;
proc sql;
    create table want2 as select variable1 from want
    group by id
    having closed=max(closed);
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 May 2018 15:09:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Splitting-Text-into-different-variables/m-p/461067#M70332</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-05-09T15:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting Text into different variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Splitting-Text-into-different-variables/m-p/461198#M70349</link>
      <description>&lt;P&gt;I'm pretty lazy, I'd probably use COMPRESS with KD and KA modifiers to separate the letters and numbers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Text $30.;
cards;
123456789
123456789CLOSED
123456-P
123456-PCLOSED
123456
123456CLOSED
987654321
25648985
;
run;

data want;
set have;

ID = compress(text, , 'kd');
ID_NUM = input(ID, 8.);
Text = compress(text, , 'ka');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 May 2018 20:59:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Splitting-Text-into-different-variables/m-p/461198#M70349</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-05-09T20:59:39Z</dc:date>
    </item>
  </channel>
</rss>

