<?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: Delete everything after the 2nd string character in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Delete-everything-after-the-2nd-string-character/m-p/714132#M27272</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The pattern searches and selections with Substr for the specified positions are very similar to some of your prior questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What have you tried so far?&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jan 2021 23:56:47 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-01-25T23:56:47Z</dc:date>
    <item>
      <title>Delete everything after the 2nd string character</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-everything-after-the-2nd-string-character/m-p/714105#M27262</link>
      <description>&lt;P&gt;I have a string&lt;/P&gt;
&lt;P&gt;:20:catclimbedthetree:STOP:dogranaftercat:STOP:catwasinthehouse:-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to delete everything after the 2nd :START: and also delete :START: i.e. the desired output is as below, what should I do? I used index function and substr but it is truncating all the characters after the first :START:. Please help.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;:20:catclimbedthetree:START:dogranaftercat&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 22:29:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-everything-after-the-2nd-string-character/m-p/714105#M27262</guid>
      <dc:creator>SAS_New_User1</dc:creator>
      <dc:date>2021-01-25T22:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Delete everything after the 2nd string character</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-everything-after-the-2nd-string-character/m-p/714112#M27265</link>
      <description>&lt;P&gt;You only have one START in your example not two. &lt;BR /&gt;Do you mean STOP?&lt;BR /&gt;Your description of the problem and example do not align.&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/361602"&gt;@SAS_New_User1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a string&lt;/P&gt;
&lt;P&gt;:20:catclimbedthetree:STOP:dogranaftercat:STOP:catwasinthehouse:-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to delete everything after the 2nd :START: and also delete :START: i.e. the desired output is as below, what should I do? I used index function and substr but it is truncating all the characters after the first :START:. Please help.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;:20:catclimbedthetree:START:dogranaftercat&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 22:40:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-everything-after-the-2nd-string-character/m-p/714112#M27265</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-25T22:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Delete everything after the 2nd string character</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-everything-after-the-2nd-string-character/m-p/714113#M27266</link>
      <description>yes, I meant :STOP:&lt;BR /&gt;&lt;BR /&gt;sorry about that</description>
      <pubDate>Mon, 25 Jan 2021 22:44:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-everything-after-the-2nd-string-character/m-p/714113#M27266</guid>
      <dc:creator>SAS_New_User1</dc:creator>
      <dc:date>2021-01-25T22:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Delete everything after the 2nd string character</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-everything-after-the-2nd-string-character/m-p/714114#M27267</link>
      <description>1. Use FINDW() to find the first STOP. &lt;BR /&gt;2. Use FINDW() again to find the second STOP - use the starting position from the first answer as a parameter to the second call to find the start of the second STOP&lt;BR /&gt;3. Use SUBSTR() to substring the string to the desired length - from  1 to the answer from step 2. &lt;BR /&gt;&lt;BR /&gt;Documentation for FINDW.&lt;BR /&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p16rdsa30vmm43n1ej4936nwa01t.htm&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p16rdsa30vmm43n1ej4936nwa01t.htm&amp;amp;locale=en&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If you're having issues post your code something as follows:&lt;BR /&gt;&lt;BR /&gt;data have;&lt;BR /&gt;string = ":20:catclimbedthetree:STOP:dogranaftercat:STOP:catwasinthehouse:-";&lt;BR /&gt;firstSTOP = findw( .... ); * you need to fill in the appropriate parameters;&lt;BR /&gt;secondStop = findw(string, ...., firstStop); * you need to fill in the appropriate parameters;&lt;BR /&gt;want = substr(1, secondSTop);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 25 Jan 2021 22:50:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-everything-after-the-2nd-string-character/m-p/714114#M27267</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-25T22:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Delete everything after the 2nd string character</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Delete-everything-after-the-2nd-string-character/m-p/714132#M27272</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The pattern searches and selections with Substr for the specified positions are very similar to some of your prior questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What have you tried so far?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 23:56:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Delete-everything-after-the-2nd-string-character/m-p/714132#M27272</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-25T23:56:47Z</dc:date>
    </item>
  </channel>
</rss>

