<?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: How to find the comma's in the string dynamically? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-comma-s-in-the-string-dynamically/m-p/694744#M211894</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
x='A,B,C,D,E,F';

n=4;
call scan(x,n,p,l,',');
position=p+l ;
putlog 'n=' n 'position=' position;


n=5;
call scan(x,n,p,l,',');
position=p+l ;
putlog 'n=' n 'position=' position;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 28 Oct 2020 06:13:53 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2020-10-28T06:13:53Z</dc:date>
    <item>
      <title>How to find the comma's in the string dynamically?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-comma-s-in-the-string-dynamically/m-p/694743#M211893</link>
      <description>&lt;P&gt;Interview Question to my friend.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;x=A,B,C,D,E,F,G ;&lt;/P&gt;
&lt;P&gt;He wants&amp;nbsp; to find 4th&amp;nbsp; comma or 5th comma.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have given this answer.&lt;/P&gt;
&lt;P&gt;data a;&lt;BR /&gt;x='A,B,C,D,E,F';&lt;BR /&gt;run;&lt;BR /&gt;%let p=9; &lt;BR /&gt;data find_comma;&lt;BR /&gt;set a;&lt;BR /&gt;fouth_comma=find(x,',',&amp;amp;p);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;Is it correct? or wrong?&lt;/P&gt;
&lt;P&gt;Interview asked me to write dynamically.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please correct if I'm&amp;nbsp; wrong.&lt;/P&gt;
&lt;P&gt;They want dynamically?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 06:04:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-comma-s-in-the-string-dynamically/m-p/694743#M211893</guid>
      <dc:creator>Saikiran_Mamidi</dc:creator>
      <dc:date>2020-10-28T06:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the comma's in the string dynamically?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-comma-s-in-the-string-dynamically/m-p/694744#M211894</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
x='A,B,C,D,E,F';

n=4;
call scan(x,n,p,l,',');
position=p+l ;
putlog 'n=' n 'position=' position;


n=5;
call scan(x,n,p,l,',');
position=p+l ;
putlog 'n=' n 'position=' position;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Oct 2020 06:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-comma-s-in-the-string-dynamically/m-p/694744#M211894</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-10-28T06:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the comma's in the string dynamically?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-comma-s-in-the-string-dynamically/m-p/694745#M211895</link>
      <description>&lt;P&gt;Have a look at &lt;A href="https://blogs.sas.com/content/sgf/2019/06/26/finding-n-th-instance-of-a-substring-within-a-string/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2019/06/26/finding-n-th-instance-of-a-substring-within-a-string/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 06:25:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-comma-s-in-the-string-dynamically/m-p/694745#M211895</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-10-28T06:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the comma's in the string dynamically?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-comma-s-in-the-string-dynamically/m-p/694802#M211927</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
    x='A,B,C,D,E,F';

    do n=4, 5;
        position=length(prxchange(cats('s/^(([^,]*,){',n,'}).*$/$1/'),1,x));
        put n= position=;
    end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Oct 2020 11:10:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-comma-s-in-the-string-dynamically/m-p/694802#M211927</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2020-10-28T11:10:29Z</dc:date>
    </item>
  </channel>
</rss>

