<?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 Scan function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Scan-function/m-p/833369#M329428</link>
    <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to scan all the phrase after 5 space.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have this code :&amp;nbsp;Ligne2 = scan(ligne,5,'') , but as result I have only one word.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you know please, how to scan all phrase after 5st space ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help !&lt;/P&gt;</description>
    <pubDate>Wed, 14 Sep 2022 16:31:56 GMT</pubDate>
    <dc:creator>SASdevAnneMarie</dc:creator>
    <dc:date>2022-09-14T16:31:56Z</dc:date>
    <item>
      <title>Scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scan-function/m-p/833369#M329428</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to scan all the phrase after 5 space.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have this code :&amp;nbsp;Ligne2 = scan(ligne,5,'') , but as result I have only one word.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you know please, how to scan all phrase after 5st space ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help !&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 16:31:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scan-function/m-p/833369#M329428</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2022-09-14T16:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scan-function/m-p/833371#M329430</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LIGNE2 = substr(ligne, 5);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SUBSTR() will extract everything from the 5th character onwards.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SCAN() with 5, looks for 5th term with a delimiter (space). Given your stated requirements I think SUBSTR() is the correct function for you usage.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to scan all the phrase after 5 space.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have this code :&amp;nbsp;Ligne2 = scan(ligne,5,'') , but as result I have only one word.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you know please, how to scan all phrase after 5st space ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help !&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 16:35:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scan-function/m-p/833371#M329430</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-09-14T16:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scan-function/m-p/833372#M329431</link>
      <description>&lt;P&gt;Please show us examples for the string you want to scan, and what you want to extract from them.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 16:40:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scan-function/m-p/833372#M329431</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-09-14T16:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: Scan function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scan-function/m-p/833379#M329435</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to scan all the phrase after 5 space.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have this code :&amp;nbsp;Ligne2 = scan(ligne,5,'') , but as result I have only one word.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you know please, how to scan all phrase after 5st space ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help !&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Scan does return ALL.&amp;nbsp; It returns the nTH term.&lt;/P&gt;
&lt;PRE&gt;1    data _null_;
2      line = 'one  two  three four five six seven';
3      line2 = scan(line,5,' ');
4      put (line line2) (=$quote.);
5    run;

line="one  two  three four five six seven" line2="five"
&lt;/PRE&gt;
&lt;P&gt;If you want the result to be "five six seven" then use CALL SCAN() and SUBSTRN().&lt;/P&gt;
&lt;PRE&gt;6    data _null_;
7      line = 'one  two  three four five six seven';
8      call scan(line,5,position,length,' ');
9      line2=substrn(line,position);
10     put (line line2) (=$quote.);
11   run;

line="one  two  three four five six seven" line2="five six seven"
&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Sep 2022 17:08:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scan-function/m-p/833379#M329435</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-09-14T17:08:42Z</dc:date>
    </item>
  </channel>
</rss>

