<?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 know  the position value for the ending character words in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-the-position-value-for-the-ending-character-words/m-p/835052#M330101</link>
    <description>&lt;P&gt;Thank you Miller i got the result.&lt;/P&gt;&lt;P&gt;Can i get the 1 and 2 position values with the provided coded?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 25 Sep 2022 13:26:34 GMT</pubDate>
    <dc:creator>saitejaguduru97</dc:creator>
    <dc:date>2022-09-25T13:26:34Z</dc:date>
    <item>
      <title>How to know  the position value for the ending character words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-the-position-value-for-the-ending-character-words/m-p/835041#M330092</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I need your help, I would like to know how to extract the position value after the second word (i.e., Kamireddy Jagan Reddy). I want the position number for (i.e.,reddy).&lt;/P&gt;&lt;P&gt;data ds1;&lt;BR /&gt;input name:&amp;amp;$35.;&lt;BR /&gt;cards;&lt;BR /&gt;Kamireddy jagan reddy&lt;BR /&gt;Adithya Desh Pandey&lt;BR /&gt;Ankit Patel Rathod&lt;BR /&gt;;run;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Sep 2022 08:03:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-know-the-position-value-for-the-ending-character-words/m-p/835041#M330092</guid>
      <dc:creator>saitejaguduru97</dc:creator>
      <dc:date>2022-09-25T08:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to know  the position value for the ending character words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-the-position-value-for-the-ending-character-words/m-p/835043#M330094</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/434763"&gt;@saitejaguduru97&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n0ecxfx00bn8i4n1vhh8up24ha6x.htm" target="_blank" rel="noopener"&gt;CALL SCAN routine&lt;/A&gt; to obtain the position and length of the &lt;EM&gt;n&lt;/EM&gt;th word of a string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set ds1;
call scan(name,3,pos,len);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Variable POS will contain the position of the first character of the third word in NAME (using &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n0ecxfx00bn8i4n1vhh8up24ha6x.htm#n0ysu43tvda01on1221uo1hanm36" target="_blank" rel="noopener"&gt;default delimiters&lt;/A&gt; as word boundaries) and variable LEN the length of this word. (Both are set to zero if there is no third word.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if you need the position of the &lt;EM&gt;last&lt;/EM&gt; character of the &lt;EM&gt;second&lt;/EM&gt; word, you can calculate it like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set ds1;
call scan(name,2,pos,len);
word2end=pos+len-1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 25 Sep 2022 08:57:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-know-the-position-value-for-the-ending-character-words/m-p/835043#M330094</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-09-25T08:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to know  the position value for the ending character words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-the-position-value-for-the-ending-character-words/m-p/835048#M330099</link>
      <description>&lt;P&gt;Thank you So much for your reply....&lt;/P&gt;&lt;P&gt;I have one more doubt regarding the same. Please find the below example:-&lt;/P&gt;&lt;P&gt;See the first variable has separated by 4 spaces and after that separated with 3 spaces only in which i need 4th position and 3rd position numbers. Can i get?&lt;/P&gt;&lt;P&gt;data ds1;&lt;BR /&gt;input name$35.;&lt;BR /&gt;datalines;&lt;BR /&gt;kamireddy jagan mohan reddy&lt;BR /&gt;nara chandrababu naidu&lt;BR /&gt;konidela pawan kalyan&lt;BR /&gt;;run;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Sep 2022 12:20:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-know-the-position-value-for-the-ending-character-words/m-p/835048#M330099</guid>
      <dc:creator>saitejaguduru97</dc:creator>
      <dc:date>2022-09-25T12:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to know  the position value for the ending character words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-the-position-value-for-the-ending-character-words/m-p/835049#M330100</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set ds1;
num_words=countw(name);
call scan(name,num_words,pos,len);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 25 Sep 2022 12:40:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-know-the-position-value-for-the-ending-character-words/m-p/835049#M330100</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-09-25T12:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to know  the position value for the ending character words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-the-position-value-for-the-ending-character-words/m-p/835052#M330101</link>
      <description>&lt;P&gt;Thank you Miller i got the result.&lt;/P&gt;&lt;P&gt;Can i get the 1 and 2 position values with the provided coded?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Sep 2022 13:26:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-know-the-position-value-for-the-ending-character-words/m-p/835052#M330101</guid>
      <dc:creator>saitejaguduru97</dc:creator>
      <dc:date>2022-09-25T13:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to know  the position value for the ending character words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-the-position-value-for-the-ending-character-words/m-p/835053#M330102</link>
      <description>&lt;P&gt;This was already explained by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Sep 2022 13:35:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-know-the-position-value-for-the-ending-character-words/m-p/835053#M330102</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-09-25T13:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to know  the position value for the ending character words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-the-position-value-for-the-ending-character-words/m-p/835057#M330103</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/434763"&gt;@saitejaguduru97&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you So much for your reply....&lt;/P&gt;
&lt;P&gt;(...)&lt;/P&gt;
&lt;P&gt;See the first variable has separated by 4 spaces and after that separated with 3 spaces only in which i need 4th position and 3rd position numbers. Can i get?&lt;/P&gt;
&lt;P&gt;(...)&lt;BR /&gt;datalines;&lt;BR /&gt;kamireddy jagan mohan reddy&lt;BR /&gt;nara chandrababu naidu&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You're welcome.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the &lt;EM&gt;last&lt;/EM&gt; word of a string you can use &lt;FONT face="courier new,courier"&gt;-1&lt;/FONT&gt; as the second argument of the CALL SCAN routine (see &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n0ecxfx00bn8i4n1vhh8up24ha6x.htm#p0j6e2h2hc4wshn12rfo9qjotof1" target="_blank" rel="noopener"&gt;count&lt;/A&gt; argument in the documentation).&lt;/P&gt;</description>
      <pubDate>Sun, 25 Sep 2022 14:09:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-know-the-position-value-for-the-ending-character-words/m-p/835057#M330103</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-09-25T14:09:32Z</dc:date>
    </item>
  </channel>
</rss>

