<?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 statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Scan-statement/m-p/930909#M366249</link>
    <description>&lt;P&gt;I think I figured out a solution&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    string='cas-shared-default datascientst _[ 0680 ] تقرير عدد البلاغات بناء على الشخص unloaded';
    word1=scan(string,1,' ');
    word2=scan(string,2,' ');
    temp_word3=scan(string,3,' ');
    where3=find(string,temp_word3,'t');
    word4=scan(string,-1,' ');
    where4=find(string,word4,'t');
    word3=substr(string,where3,where4-where3-length(temp_word3)-1);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In order for the above to be a correct answer, I have made a number of assumptions and decided upon a logic which may not be correct for other text strings that you have.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jun 2024 12:13:22 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2024-06-05T12:13:22Z</dc:date>
    <item>
      <title>Scan statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scan-statement/m-p/930900#M366244</link>
      <description>&lt;P&gt;Greeting of the day!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have below column as demo_table which has a row like this, so when I'm using scan function to split them into separate columns then third column is not scanning properly.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;cas-shared-default datascientst _[ 0680 ] تقرير عدد البلاغات بناء على الشخص unloaded&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;Server_Name=scan(Table_Names, 1, '');&lt;/DIV&gt;
&lt;DIV&gt;CASLIB_Name=scan(Table_Names, 2, '');&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Table_Name=scan(Table_Names, 3, '');&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Table_State=scan(Table_Names,-1);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SurajChand_0-1717586338505.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/97020i8867CB454328F1B0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SurajChand_0-1717586338505.png" alt="SurajChand_0-1717586338505.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 05 Jun 2024 11:19:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scan-statement/m-p/930900#M366244</guid>
      <dc:creator>SurajChand</dc:creator>
      <dc:date>2024-06-05T11:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Scan statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scan-statement/m-p/930905#M366245</link>
      <description>&lt;P&gt;What is wrong with the result? It seems perfectly correct to me, based upon the code you wrote. What result are you expecting?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2024 11:28:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scan-statement/m-p/930905#M366245</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-06-05T11:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Scan statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scan-statement/m-p/930906#M366246</link>
      <description>I want Table_Name column should have full table name instead of some portion &lt;BR /&gt;Expected result &lt;BR /&gt;_[ 0680 ] تقرير عدد البلاغات بناء على الشخص&lt;BR /&gt;Current result&lt;BR /&gt;_[</description>
      <pubDate>Wed, 05 Jun 2024 11:32:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scan-statement/m-p/930906#M366246</guid>
      <dc:creator>SurajChand</dc:creator>
      <dc:date>2024-06-05T11:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Scan statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scan-statement/m-p/930907#M366247</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/42678"&gt;@SurajChand&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I want Table_Name column should have full table name instead of some portion &lt;BR /&gt;Expected result &lt;BR /&gt;_[ 0680 ] تقرير عدد البلاغات بناء على الشخص&lt;BR /&gt;Current result&lt;BR /&gt;_[&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please describe the logic that a programmer could use to determine that some spaces are to be used as separators between words but other spaces are not used that way. I am not asking for code, I am asking for words to explain this.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2024 11:36:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scan-statement/m-p/930907#M366247</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-06-05T11:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: Scan statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scan-statement/m-p/930908#M366248</link>
      <description>I appreciate your statement, but I'm SAS Administrator and I found some example online so I tried. Please accept the apology!!</description>
      <pubDate>Wed, 05 Jun 2024 11:39:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scan-statement/m-p/930908#M366248</guid>
      <dc:creator>SurajChand</dc:creator>
      <dc:date>2024-06-05T11:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Scan statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scan-statement/m-p/930909#M366249</link>
      <description>&lt;P&gt;I think I figured out a solution&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    string='cas-shared-default datascientst _[ 0680 ] تقرير عدد البلاغات بناء على الشخص unloaded';
    word1=scan(string,1,' ');
    word2=scan(string,2,' ');
    temp_word3=scan(string,3,' ');
    where3=find(string,temp_word3,'t');
    word4=scan(string,-1,' ');
    where4=find(string,word4,'t');
    word3=substr(string,where3,where4-where3-length(temp_word3)-1);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In order for the above to be a correct answer, I have made a number of assumptions and decided upon a logic which may not be correct for other text strings that you have.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2024 12:13:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scan-statement/m-p/930909#M366249</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-06-05T12:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Scan statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scan-statement/m-p/930911#M366251</link>
      <description>&lt;P&gt;There is no SCAN &lt;EM&gt;statement&lt;/EM&gt; in SAS. There is the SCAN&amp;nbsp;&lt;EM&gt;function&lt;/EM&gt; and the CALL SCAN&amp;nbsp;&lt;EM&gt;subroutine&lt;/EM&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2024 11:59:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scan-statement/m-p/930911#M366251</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-06-05T11:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Scan statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scan-statement/m-p/931078#M366311</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
Table_Names="cas-shared-default datascientst _[ 0680 ] تقرير عدد البلاغات بناء على الشخص unloaded";

Server_Name=scan(Table_Names, 1, ' ');
CASLIB_Name=scan(Table_Names, 2, ' ');

call scan(Table_Names,3,p1,l1,' ');
call scan(Table_Names,-1,p2,l2,' ');
Table_Name=substr(Table_Names,p1,p2-p1);

Table_State=scan(Table_Names,-1, ' ');
drop p1 p2 l1 l2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Jun 2024 02:19:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scan-statement/m-p/931078#M366311</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-06-06T02:19:31Z</dc:date>
    </item>
  </channel>
</rss>

