<?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: can i define double space as a separator in sas scan function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/can-i-define-double-space-as-a-separator-in-sas-scan-function/m-p/285843#M58519</link>
    <description>&lt;P&gt;Work around would likely involve the INDEX function which returns the start position of one string within another or zero if not found.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;pos = index(&lt;FONT face="Courier New"&gt;tpp_name&lt;/FONT&gt; ,'&amp;nbsp; ');&lt;/P&gt;
&lt;P&gt;sender = substr(&lt;FONT face="Courier New"&gt;tpp_name&lt;/FONT&gt; ,1,pos-1);&lt;/P&gt;
&lt;P&gt;receiver =&amp;nbsp; substr(&lt;FONT face="Courier New"&gt;tpp_name&lt;/FONT&gt; ,pos+2);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;should work but you should set the lengths of the sender and receiver varaibles before use.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jul 2016 15:00:42 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-07-20T15:00:42Z</dc:date>
    <item>
      <title>can i define double space as a separator in sas scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-i-define-double-space-as-a-separator-in-sas-scan-function/m-p/285841#M58517</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a field that have two names in it, separated by two-spaces. how do I get only the second person from this field?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;examples:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---1st person--------&amp;nbsp; -----2nd person------&lt;/P&gt;&lt;P&gt;LUKASZ STASIAK&amp;nbsp; ANNA KAROWIEC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^1 space&amp;nbsp;&amp;nbsp;&amp;nbsp; ^2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------1st person---------&amp;nbsp; ------------2nd person---------&lt;/P&gt;&lt;P&gt;ADAM KAPEC KOWALKI&amp;nbsp; JURAND ZE SPYCHOWA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ^2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^1&amp;nbsp;&amp;nbsp;^1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this:&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;sender&amp;nbsp;&amp;nbsp; = scan(tpp_name, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;, &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;" "&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;receiver = scan(tpp_name, &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;, &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;" "&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;treats the "&amp;nbsp; " as &amp;lt;space separator&amp;gt;&amp;lt;space separator&amp;gt; not &amp;lt;double space separator&amp;gt;. Is there any workaround for that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Lukasz&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2016 14:53:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-i-define-double-space-as-a-separator-in-sas-scan-function/m-p/285841#M58517</guid>
      <dc:creator>LukaszStasiak</dc:creator>
      <dc:date>2016-07-20T14:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: can i define double space as a separator in sas scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-i-define-double-space-as-a-separator-in-sas-scan-function/m-p/285843#M58519</link>
      <description>&lt;P&gt;Work around would likely involve the INDEX function which returns the start position of one string within another or zero if not found.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;pos = index(&lt;FONT face="Courier New"&gt;tpp_name&lt;/FONT&gt; ,'&amp;nbsp; ');&lt;/P&gt;
&lt;P&gt;sender = substr(&lt;FONT face="Courier New"&gt;tpp_name&lt;/FONT&gt; ,1,pos-1);&lt;/P&gt;
&lt;P&gt;receiver =&amp;nbsp; substr(&lt;FONT face="Courier New"&gt;tpp_name&lt;/FONT&gt; ,pos+2);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;should work but you should set the lengths of the sender and receiver varaibles before use.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2016 15:00:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-i-define-double-space-as-a-separator-in-sas-scan-function/m-p/285843#M58519</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-07-20T15:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: can i define double space as a separator in sas scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-i-define-double-space-as-a-separator-in-sas-scan-function/m-p/286026#M58593</link>
      <description>&lt;P&gt;Check modification 'M':&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;scan(tpp_name, &lt;FONT color="#008080"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;" ",'m'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2016 02:46:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-i-define-double-space-as-a-separator-in-sas-scan-function/m-p/286026#M58593</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-07-21T02:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: can i define double space as a separator in sas scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-i-define-double-space-as-a-separator-in-sas-scan-function/m-p/286050#M58599</link>
      <description>&lt;P&gt;doesn't work as intended - it returns the second word from the string&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2016 07:47:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-i-define-double-space-as-a-separator-in-sas-scan-function/m-p/286050#M58599</guid>
      <dc:creator>LukaszStasiak</dc:creator>
      <dc:date>2016-07-21T07:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: can i define double space as a separator in sas scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-i-define-double-space-as-a-separator-in-sas-scan-function/m-p/286130#M58634</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Both FIND and INDEX worked for me.&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4163i158795C0F4E874A3/image-size/original?v=v2&amp;amp;px=-1" alt="use_substr_with_index.png" title="use_substr_with_index.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2016 13:51:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-i-define-double-space-as-a-separator-in-sas-scan-function/m-p/286130#M58634</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-07-21T13:51:33Z</dc:date>
    </item>
  </channel>
</rss>

