<?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: Remove everything after a delimiter/ SAS in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Remove-everything-after-a-delimiter-SAS/m-p/713382#M27153</link>
    <description>&lt;P&gt;please try the perl regular expression&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
string="4527488//ahdjs}hdu:34ahdgj:60A:283748 8q79979A B B C Dajhed}{-5 jkqedhkkh36929 82939 A D.";
string2=prxchange('s/(.*)(\}{.*)/$1/oi',-1,string);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 22 Jan 2021 15:39:12 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2021-01-22T15:39:12Z</dc:date>
    <item>
      <title>Remove everything after a delimiter/ SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-everything-after-a-delimiter-SAS/m-p/713377#M27149</link>
      <description>&lt;P&gt;I have a string as below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4527488//ahdjs}hdu:34ahdgj:60A:283748 8q79979A B B C Dajhed}{-5 jkqedhkkh36929 82939 A D.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to remove everything after " }{-5" , including "}{-5" i.e. desired output is as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4527488//ahdjs}hdu:34ahdgj:60A:283748 8q79979A B B C Dajhed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there can be a } or { or - or 5 before or after the above combination but never in the combined &amp;nbsp;"}{-5" combination format. I want to remove everything after this "}{-5" combination, including the combination.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 15:19:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-everything-after-a-delimiter-SAS/m-p/713377#M27149</guid>
      <dc:creator>SAS_New_User1</dc:creator>
      <dc:date>2021-01-22T15:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Remove everything after a delimiter/ SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-everything-after-a-delimiter-SAS/m-p/713379#M27150</link>
      <description>&lt;P&gt;One way&lt;/P&gt;
&lt;PRE&gt;data example;
   x="4527488//ahdjs}hdu:34ahdgj:60A:283748 8q79979A B B C Dajhed}{-5 jkqedhkkh36929 82939 A D.";
   newx = substr(x,1,index(x,"}{-5") -1);
run;&lt;/PRE&gt;
&lt;P&gt;The Index function returns the character position where the target string starts. So you want to end one position prior to that, so there is a -1. Substr selects characters in positions between the two position number including the ends.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 15:29:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-everything-after-a-delimiter-SAS/m-p/713379#M27150</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-22T15:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Remove everything after a delimiter/ SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-everything-after-a-delimiter-SAS/m-p/713381#M27152</link>
      <description>&lt;P&gt;Please try the below code&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input string &amp;amp;:$200.;
datalines4;
4527488//ahdjs}hdu:34ahdgj:60A:283748 8q79979A B B C Dajhed}{-5 jkqedhkkh36929 82939 A D.
;;;;

data want;
set have;
pos=index(string,'}{');
string2=substr(string,1,pos-1);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Jan 2021 15:31:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-everything-after-a-delimiter-SAS/m-p/713381#M27152</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2021-01-22T15:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Remove everything after a delimiter/ SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-everything-after-a-delimiter-SAS/m-p/713382#M27153</link>
      <description>&lt;P&gt;please try the perl regular expression&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
string="4527488//ahdjs}hdu:34ahdgj:60A:283748 8q79979A B B C Dajhed}{-5 jkqedhkkh36929 82939 A D.";
string2=prxchange('s/(.*)(\}{.*)/$1/oi',-1,string);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Jan 2021 15:39:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-everything-after-a-delimiter-SAS/m-p/713382#M27153</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2021-01-22T15:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: Remove everything after a delimiter/ SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-everything-after-a-delimiter-SAS/m-p/713592#M27182</link>
      <description>&lt;PRE&gt;data want;
string="4527488//ahdjs}hdu:34ahdgj:60A:283748 8q79979A B B C Dajhed}{-5 jkqedhkkh36929 82939 A D.";
string2=prxchange('s/(}{.*)//oi',-1,strip(string));
run;&lt;/PRE&gt;</description>
      <pubDate>Sat, 23 Jan 2021 12:08:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-everything-after-a-delimiter-SAS/m-p/713592#M27182</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-01-23T12:08:48Z</dc:date>
    </item>
  </channel>
</rss>

