<?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: SCAN function with same delimiter repeated in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SCAN-function-with-same-delimiter-repeated/m-p/528549#M144271</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/223452"&gt;@r_behata&lt;/a&gt;&amp;nbsp; Nice , but imho not so convenient as no need to compute pos which is derivative of call scan. Also, you'd have to drop the pos,len vars after. So all in all, interesting indeed but I don't think that's a convenient/needful alternative.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 19 Jan 2019 18:03:53 GMT</pubDate>
    <dc:creator>Allaluiah</dc:creator>
    <dc:date>2019-01-19T18:03:53Z</dc:date>
    <item>
      <title>SCAN function with same delimiter repeated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SCAN-function-with-same-delimiter-repeated/m-p/528522#M144263</link>
      <description>&lt;P&gt;I have a string with same delimiter repeated multiple times, but i want to extract it at respective position only&lt;BR /&gt;Like in the example below&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;string is "this text = contains (values with= same delimiter "(multiple times), delimiter=")" ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Required output is &lt;STRONG&gt;contains (values with= same delimiter "(multiple times), delimiter=")" ;&lt;/STRONG&gt;&lt;BR /&gt;But the Present output is displayed as &amp;nbsp;&lt;STRONG&gt;contains (values with&lt;/STRONG&gt;&lt;BR /&gt;This is getting truncated when the same delimiter is found again&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code used to test&lt;BR /&gt;var=scan(string,2,"=") ;&lt;BR /&gt;with modifier var=scan(string,2,"=","o")&lt;BR /&gt;still getting the same result as above&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any way by which we can control the same delimiter to ignore while scanning to get the required output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jan 2019 14:11:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SCAN-function-with-same-delimiter-repeated/m-p/528522#M144263</guid>
      <dc:creator>keen_sas</dc:creator>
      <dc:date>2019-01-19T14:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: SCAN function with same delimiter repeated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SCAN-function-with-same-delimiter-repeated/m-p/528524#M144264</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data desired;
str='"this text = contains (values with= same delimiter "(multiple times), delimiter=")"' ;
want=substr(str,findc(str,'=')+1);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 19 Jan 2019 14:29:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SCAN-function-with-same-delimiter-repeated/m-p/528524#M144264</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-01-19T14:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: SCAN function with same delimiter repeated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SCAN-function-with-same-delimiter-repeated/m-p/528545#M144270</link>
      <description>&lt;P&gt;The 'o' modifier improves the efficiency of the scan function by not processing the list of modifiers again, it would improve performance if the scan function is inside a loop. This does not mean that it would ignore the second occurrence of the delimiter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The solution provided by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;would work in your scenario.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an other alternative.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data want;
	str='this text = contains (values with= same delimiter "(multiple times), delimiter=")';
	call scan(str,1,pos,ln,'=');
	var=substrn(str,(ln+2));
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jan 2019 17:43:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SCAN-function-with-same-delimiter-repeated/m-p/528545#M144270</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2019-01-19T17:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: SCAN function with same delimiter repeated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SCAN-function-with-same-delimiter-repeated/m-p/528549#M144271</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/223452"&gt;@r_behata&lt;/a&gt;&amp;nbsp; Nice , but imho not so convenient as no need to compute pos which is derivative of call scan. Also, you'd have to drop the pos,len vars after. So all in all, interesting indeed but I don't think that's a convenient/needful alternative.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jan 2019 18:03:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SCAN-function-with-same-delimiter-repeated/m-p/528549#M144271</guid>
      <dc:creator>Allaluiah</dc:creator>
      <dc:date>2019-01-19T18:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: SCAN function with same delimiter repeated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SCAN-function-with-same-delimiter-repeated/m-p/528551#M144272</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/48036"&gt;@Allaluiah&lt;/a&gt;&amp;nbsp;, As I said it was just an other way of approaching the problem. Agreed, that&amp;nbsp; it may not be the most&amp;nbsp;convenient in this scenario.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, you also need to know that generally the call routines are efficient than the functions. Also, The call scan extends the capabilities of the regular scan function by providing dynamic position and length which may be useful to the OP if he comes across a different scenario, if it is not for you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jan 2019 18:45:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SCAN-function-with-same-delimiter-repeated/m-p/528551#M144272</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2019-01-19T18:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: SCAN function with same delimiter repeated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SCAN-function-with-same-delimiter-repeated/m-p/528628#M144308</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
string='"this text = contains (values with= same delimiter "(multiple times), delimiter=")"' ;
newstring=prxchange('s/^.*?=//', 1, string);

put string= // newstring=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 20 Jan 2019 17:29:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SCAN-function-with-same-delimiter-repeated/m-p/528628#M144308</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-01-20T17:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: SCAN function with same delimiter repeated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SCAN-function-with-same-delimiter-repeated/m-p/529010#M144469</link>
      <description>&lt;P&gt;There are two possible solutions to this.&lt;/P&gt;
&lt;P&gt;What do you want if you have a string like 'a==b=c'?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you want the result to be '=b=c' (which is not a SCAN solution, as consecutive delimiters are treated as one by SCAN), then the INDEXC solution suggested by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt; is the way to go, if you want the result 'b=c' then take a look at the CALL SCAN routine, as suggested by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/223452"&gt;@r_behata&lt;/a&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 10:48:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SCAN-function-with-same-delimiter-repeated/m-p/529010#M144469</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2019-01-22T10:48:51Z</dc:date>
    </item>
  </channel>
</rss>

