<?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 deleting different sized parts of a cell in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159373#M2901</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;suppose I have a table with several columns:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="131" style="border: 1px solid rgb(0, 0, 0); width: 320px; height: 133px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;info1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;info2&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ABC (gfd)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;a&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;b&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;DEF ( h&amp;nbsp; ffdds)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;c&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;d&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Z&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;e&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;f&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I would like to do if possible is to delete the parentheses for the name column entries and all that is inside those parentheses, and note that the length of the part that I want to be deleted varies from entry to entry, and I have many rows... And the entries without the parentheses keep as is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the end result should be like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="146" style="border: 1px solid rgb(0, 0, 0); width: 318px; height: 148px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;info1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;info2&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ABC&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;a&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;b&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;DEF&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;c&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;d&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Z&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;e&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;f&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 21 Dec 2014 14:34:48 GMT</pubDate>
    <dc:creator>ilikesas</dc:creator>
    <dc:date>2014-12-21T14:34:48Z</dc:date>
    <item>
      <title>deleting different sized parts of a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159373#M2901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;suppose I have a table with several columns:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="131" style="border: 1px solid rgb(0, 0, 0); width: 320px; height: 133px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;info1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;info2&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ABC (gfd)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;a&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;b&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;DEF ( h&amp;nbsp; ffdds)&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;c&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;d&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Z&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;e&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;f&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I would like to do if possible is to delete the parentheses for the name column entries and all that is inside those parentheses, and note that the length of the part that I want to be deleted varies from entry to entry, and I have many rows... And the entries without the parentheses keep as is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the end result should be like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="146" style="border: 1px solid rgb(0, 0, 0); width: 318px; height: 148px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;info1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;info2&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ABC&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;a&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;b&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;DEF&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;c&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;d&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Z&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;e&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;f&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Dec 2014 14:34:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159373#M2901</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2014-12-21T14:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: deleting different sized parts of a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159374#M2902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; name=scan(name,1,'(');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Dec 2014 14:53:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159374#M2902</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-12-21T14:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: deleting different sized parts of a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159375#M2903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dr for the quick reply, it worked perfectly!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess that the meaning of the code is that it deletes for a given entry everything after and including the first ( and returns the entry in its new form&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Dec 2014 15:08:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159375#M2903</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2014-12-21T15:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: deleting different sized parts of a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159376#M2904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mostly, but I would say that it extracts all of the characters before the first '('.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Dec 2014 15:19:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159376#M2904</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-12-21T15:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: deleting different sized parts of a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159377#M2905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And what if the parentheses are in the middle of the entry, like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABC (fjfj fjfj l ) DEF&lt;/P&gt;&lt;P&gt; and the result that we want to get if ABC DEF ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does the code for this require 2 scans and a concatenation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Dec 2014 15:21:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159377#M2905</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2014-12-21T15:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: deleting different sized parts of a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159378#M2906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is what I would do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat name $25.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input name &amp;amp;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;ABC (fjfj fjfj l ) DEF&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; name=catt(scan(name,1,'('),scan(name,-1,')'));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Dec 2014 15:46:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159378#M2906</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-12-21T15:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: deleting different sized parts of a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159379#M2907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Worked!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank a lot!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Dec 2014 15:52:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159379#M2907</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2014-12-21T15:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: deleting different sized parts of a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159380#M2908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perl Regular Expression Version :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;

data have;
&amp;nbsp; informat name $25.;
&amp;nbsp; input name &amp;amp;;
&amp;nbsp; cards;
ABC (gfd)
ABC (fjfj fjfj l ) DEF
DEF ( h ffdds)
;
 
data want;
&amp;nbsp; set have;
&amp;nbsp; name=prxchange('s/\(.*\)//o',-1,name);
run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 08:24:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159380#M2908</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-12-22T08:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: deleting different sized parts of a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159381#M2909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks xia keshan, I wish I could put more than one correct answer!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2014 04:58:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159381#M2909</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2014-12-24T04:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: deleting different sized parts of a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159382#M2910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What if we've '%' around characters? e.g. ABC %fjfj fjfj l% DEF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need the output as ABC DEF. I'm curious to know the p&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;erl regular expression version for this case.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2014 06:41:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159382#M2910</guid>
      <dc:creator>RamKumar</dc:creator>
      <dc:date>2014-12-24T06:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: deleting different sized parts of a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159383#M2911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK. Here is . Peal Regular Expression &lt;STRONG&gt;&amp;nbsp; \(.*\)|%.*%&lt;/STRONG&gt;&amp;nbsp; just match the pattern&amp;nbsp; (fjfj fjfj l )&amp;nbsp; or&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; %fjfj fjfj l%&amp;nbsp; , you cold check it more in the sas documentation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;

data have;
&amp;nbsp; informat name $25.;
&amp;nbsp; input name &amp;amp;;
&amp;nbsp; cards;
ABC (gfd)
ABC (fjfj fjfj l ) DEF
DEF ( h ffdds)
ABC %fjfj fjfj l% DEF
;
 
data want;
&amp;nbsp; set have;
&amp;nbsp; name=prxchange('s/\(.*\)|%.*%//o',-1,name);
run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2014 06:58:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/deleting-different-sized-parts-of-a-cell/m-p/159383#M2911</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-12-24T06:58:49Z</dc:date>
    </item>
  </channel>
</rss>

