<?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: Deleting a string between two strings in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Deleting-a-string-between-two-strings/m-p/713039#M27109</link>
    <description>&lt;PRE&gt;data have;
length eg $500;
eg='abcdefgs:456:fdkweu/:START:41A:45583993:START:60A:6483829992:STOP:59:hagdsu2381ygu:73:';
output;
eg='hsdgsdgcj:64:54:adcg6edd:START:71A:274765765:START:84A:26357457454:STOP:59:2237fdguef';
output;
run;
data want;
 set have;
 want=prxchange('s/start.+stop/START::STOP/i',1,eg);
 run;&lt;/PRE&gt;</description>
    <pubDate>Thu, 21 Jan 2021 12:12:11 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2021-01-21T12:12:11Z</dc:date>
    <item>
      <title>Deleting a string between two strings</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Deleting-a-string-between-two-strings/m-p/712806#M27079</link>
      <description>&lt;P&gt;I have a string&amp;nbsp;&lt;/P&gt;&lt;P&gt;example 1: abcdefgs:456:fdkweu/:START:&lt;STRONG&gt;&lt;U&gt;41A:45583993:START:60A:6483829992&lt;/U&gt;&lt;/STRONG&gt;:STOP:59:hagdsu2381ygu:73:&lt;/P&gt;&lt;P&gt;example 2:&lt;/P&gt;&lt;P&gt;hsdgsdgcj:64:54:adcg6edd:START:&lt;STRONG&gt;&lt;U&gt;71A:274765765:START:84A:26357457454&lt;/U&gt;&lt;/STRONG&gt;:STOP:59:2237fdguef&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to delete any string between the 1st START and STOP strings i.e. the output should look like below. I want to delete everything that is underline above:&lt;/P&gt;&lt;P&gt;Output 1:&lt;/P&gt;&lt;P&gt;abcdefgs:456:fdkweu/:START::STOP:59:hagdsu2381ygu:73:&lt;/P&gt;&lt;P&gt;Output 2:&lt;/P&gt;&lt;P&gt;hsdgsdgcj:64:54:adcg6edd:START::STOP:59:2237fdguef&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the below solution of 1st identifying the string I want to remove between the first START and STOP, which I was able to identify with the code below. Next I am trying to use tranward to drop this identified string from the original column, but with no success.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;length newstring $1000;&lt;/P&gt;&lt;P&gt;startpos = index(string,":START:");&lt;/P&gt;&lt;P&gt;endpos = index (string, startpos+7, endpos-(startpos+7));&lt;/P&gt;&lt;P&gt;drop startpos endpos;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT face="andale mono,times"&gt;string = tranward(string, new string, "");&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to code for the first part and it works fine where I can identify the sub string I want to drop from the main string. However, I am not able to drop the identified string from the main string, using tranward. I am unable to query it correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help with the red part of the code.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 18:03:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Deleting-a-string-between-two-strings/m-p/712806#M27079</guid>
      <dc:creator>SAS_New_User1</dc:creator>
      <dc:date>2021-01-20T18:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting a string between two strings</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Deleting-a-string-between-two-strings/m-p/712812#M27080</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    startpos=find(string,":START:"0)+6;
    endpos=find(string,":STOP:");
    string = cats(substr(string,1,startpos),substr(string,endpos));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Jan 2021 18:16:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Deleting-a-string-between-two-strings/m-p/712812#M27080</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-20T18:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting a string between two strings</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Deleting-a-string-between-two-strings/m-p/712829#M27081</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
length eg $500;
eg='abcdefgs:456:fdkweu/:START:41A:45583993:START:60A:6483829992:STOP:59:hagdsu2381ygu:73:';
output;
eg='hsdgsdgcj:64:54:adcg6edd:START:71A:274765765:START:84A:26357457454:STOP:59:2237fdguef';
output;
run;

data want;
 set have;
 length want $250;
 want=cats(substr(eg,1,index(eg,'START')+5),substr(eg,index(eg,'STOP')-1));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Jan 2021 18:38:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Deleting-a-string-between-two-strings/m-p/712829#M27081</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2021-01-20T18:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting a string between two strings</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Deleting-a-string-between-two-strings/m-p/712921#M27090</link>
      <description>&lt;P&gt;Both of these solutions work very well.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 22:49:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Deleting-a-string-between-two-strings/m-p/712921#M27090</guid>
      <dc:creator>SAS_New_User1</dc:creator>
      <dc:date>2021-01-20T22:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting a string between two strings</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Deleting-a-string-between-two-strings/m-p/713039#M27109</link>
      <description>&lt;PRE&gt;data have;
length eg $500;
eg='abcdefgs:456:fdkweu/:START:41A:45583993:START:60A:6483829992:STOP:59:hagdsu2381ygu:73:';
output;
eg='hsdgsdgcj:64:54:adcg6edd:START:71A:274765765:START:84A:26357457454:STOP:59:2237fdguef';
output;
run;
data want;
 set have;
 want=prxchange('s/start.+stop/START::STOP/i',1,eg);
 run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jan 2021 12:12:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Deleting-a-string-between-two-strings/m-p/713039#M27109</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-01-21T12:12:11Z</dc:date>
    </item>
  </channel>
</rss>

