<?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 Urgent: Extract the characters before the first occurrence of ' ' or '-' in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Urgent-Extract-the-characters-before-the-first-occurrence-of-or/m-p/693045#M211258</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Need to extract the characters before the first occurrence of ' ' or '-'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For example: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'ROM A STAR' output: 'ROM' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'ROMA STAR-RAN' output:'ROMA' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'VNAM-RAN STR' output: 'VNAM' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'K-NIT RAN-STA' output: 'K'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Tue, 20 Oct 2020 23:38:33 GMT</pubDate>
    <dc:creator>tosasvj</dc:creator>
    <dc:date>2020-10-20T23:38:33Z</dc:date>
    <item>
      <title>Urgent: Extract the characters before the first occurrence of ' ' or '-'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Urgent-Extract-the-characters-before-the-first-occurrence-of-or/m-p/693045#M211258</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Need to extract the characters before the first occurrence of ' ' or '-'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For example: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'ROM A STAR' output: 'ROM' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'ROMA STAR-RAN' output:'ROMA' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'VNAM-RAN STR' output: 'VNAM' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'K-NIT RAN-STA' output: 'K'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 23:38:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Urgent-Extract-the-characters-before-the-first-occurrence-of-or/m-p/693045#M211258</guid>
      <dc:creator>tosasvj</dc:creator>
      <dc:date>2020-10-20T23:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent: Extract the characters before the first occurrence of ' ' or '-'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Urgent-Extract-the-characters-before-the-first-occurrence-of-or/m-p/693047#M211259</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input var $quote20.;
cards;
'ROM A STAR' 
'ROMA STAR-RAN' 
'VNAM-RAN STR' 
'K-NIT RAN-STA' 
;
data Need;
 set have;
 length need $20;
 need=scan(var,1,' -');
run;
/*or*/
data Need;
 set have;
 length need $20;
 need=prxchange('s/^([a-z]+)[-\s].*/$1/i', -1, var);
run;
/*or even NOTALPHA*/
data Need;
 set have;
 length need $20;
 need=substr(var,1,notalpha(var)-1);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Oct 2020 00:25:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Urgent-Extract-the-characters-before-the-first-occurrence-of-or/m-p/693047#M211259</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-10-21T00:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent: Extract the characters before the first occurrence of ' ' or '-'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Urgent-Extract-the-characters-before-the-first-occurrence-of-or/m-p/693062#M211267</link>
      <description>&lt;P&gt;thank you!!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 03:30:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Urgent-Extract-the-characters-before-the-first-occurrence-of-or/m-p/693062#M211267</guid>
      <dc:creator>tosasvj</dc:creator>
      <dc:date>2020-10-21T03:30:34Z</dc:date>
    </item>
  </channel>
</rss>

