<?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 Removing completely the parentheses expression in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Removing-completely-the-parentheses-expression/m-p/608641#M177163</link>
    <description>&lt;P&gt;Hi guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have special names which contain parentheses. I like to remove the whole&amp;nbsp;parentheses expression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I have is this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;166/666-C-122 PP3(ZIAN)&lt;/P&gt;
&lt;P&gt;199/999-H-888 ZZZ(PLING)&lt;/P&gt;
&lt;P&gt;Z-12(AAAAAAA)&lt;/P&gt;
&lt;P&gt;Z-2T (NILGON)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And what I need is this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;166/666-C-122 PP3&lt;/P&gt;
&lt;P&gt;199/999-H-888 ZZZ&lt;/P&gt;
&lt;P&gt;Z-12&lt;/P&gt;
&lt;P&gt;Z-2T&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please help me with it?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please note the space inside the names. Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Farshid&lt;/P&gt;</description>
    <pubDate>Mon, 02 Dec 2019 08:53:04 GMT</pubDate>
    <dc:creator>farshidowrang</dc:creator>
    <dc:date>2019-12-02T08:53:04Z</dc:date>
    <item>
      <title>Removing completely the parentheses expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-completely-the-parentheses-expression/m-p/608641#M177163</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have special names which contain parentheses. I like to remove the whole&amp;nbsp;parentheses expression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I have is this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;166/666-C-122 PP3(ZIAN)&lt;/P&gt;
&lt;P&gt;199/999-H-888 ZZZ(PLING)&lt;/P&gt;
&lt;P&gt;Z-12(AAAAAAA)&lt;/P&gt;
&lt;P&gt;Z-2T (NILGON)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And what I need is this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;166/666-C-122 PP3&lt;/P&gt;
&lt;P&gt;199/999-H-888 ZZZ&lt;/P&gt;
&lt;P&gt;Z-12&lt;/P&gt;
&lt;P&gt;Z-2T&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please help me with it?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please note the space inside the names. Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Farshid&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 08:53:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-completely-the-parentheses-expression/m-p/608641#M177163</guid>
      <dc:creator>farshidowrang</dc:creator>
      <dc:date>2019-12-02T08:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Removing completely the parentheses expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-completely-the-parentheses-expression/m-p/608643#M177165</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/236353"&gt;@farshidowrang&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming the word in parenthesis is at the end of the character expression, you can try this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set have;
	var2 = trim(substr(var1, 1, index(var1,"(")-1));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Dec 2019 08:58:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-completely-the-parentheses-expression/m-p/608643#M177165</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-12-02T08:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Removing completely the parentheses expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-completely-the-parentheses-expression/m-p/608646#M177166</link>
      <description>&lt;P&gt;Or maybe even something shorter:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set have;
	var2 = scan(var1, 1, "(");
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;All the best&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 09:16:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-completely-the-parentheses-expression/m-p/608646#M177166</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2019-12-02T09:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: Removing completely the parentheses expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-completely-the-parentheses-expression/m-p/608647#M177167</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input string :$&amp;amp;100.;
datalines;
166/666-C-122 PP3(ZIAN)
199/999-H-888 ZZZ(PLING)
Z-12(AAAAAAA)
Z-2T (NILGON)
;

data want;
    set have;
    newstring=prxchange('s/\(.*\)//', -1, string);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;string                    newstring 
166/666-C-122 PP3(ZIAN)   166/666-C-122 PP3 
199/999-H-888 ZZZ(PLING)  199/999-H-888 ZZZ 
Z-12(AAAAAAA)             Z-12 
Z-2T (NILGON)             Z-2T 
&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Dec 2019 09:15:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-completely-the-parentheses-expression/m-p/608647#M177167</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-12-02T09:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: Removing completely the parentheses expression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-completely-the-parentheses-expression/m-p/608678#M177173</link>
      <description>&lt;P&gt;If you have such kind of data, you will get wrong result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards truncover;
input string $100.;
datalines;
166/666-C-(122) PP3(ZIAN)
199/999-H-(888) ZZZ(PLING)
Z-12(AAAAAAA)
Z-2T (NILGON)XXXX
;

data want;
    set have;
    newstring=prxchange('s/\(.*?\)//', -1, string);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Dec 2019 11:36:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-completely-the-parentheses-expression/m-p/608678#M177173</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-12-02T11:36:35Z</dc:date>
    </item>
  </channel>
</rss>

