<?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: Removing string - in the data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106516#M29664</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Lin lin. but when I have "-" in the middle its getting removed too. For instance in the following example for the third value "&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;-a-b&lt;/SPAN&gt;" have "-" at the begining and the middle also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data have;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;input v$;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;cards;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;abc&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;-bc&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;-a-b&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;When I tried the following code,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: #800080;"&gt;if first(v)='-'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff;"&gt; then v=compress(v,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: #800080;"&gt;'-'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;My output is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;abc&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;bc&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ab&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;but the required output is (i.e If there is any "_" in the middle other than first position I need to keep it as is)&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;abc&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;bc&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;a-b&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Please help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Apr 2013 15:16:09 GMT</pubDate>
    <dc:creator>muralip2013</dc:creator>
    <dc:date>2013-04-12T15:16:09Z</dc:date>
    <item>
      <title>Removing string - in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106508#M29656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi i have the following data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CRit&lt;/P&gt;&lt;P&gt;-currrent or prior tre&lt;/P&gt;&lt;P&gt;-prior use of treat&lt;/P&gt;&lt;P&gt;i am trying to get rid of&amp;nbsp; '-'&amp;nbsp; hypen&amp;nbsp; at starting of each value.&lt;/P&gt;&lt;P&gt;could any one please help me out to remove that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 13:22:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106508#M29656</guid>
      <dc:creator>muralip2013</dc:creator>
      <dc:date>2013-04-12T13:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Removing string - in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106509#M29657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; string = "-minus";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt; new_string = translate(string,"","-");&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 13:45:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106509#M29657</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-04-12T13:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Removing string - in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106510#M29658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try to use compress(variable,'-'); check the sample code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newvar=compress(variable,'-');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code will remove the '-' hyphen from the variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jagadish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 13:50:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106510#M29658</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2013-04-12T13:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Removing string - in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106511#M29659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tilea. That worked perfectly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 14:31:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106511#M29659</guid>
      <dc:creator>muralip2013</dc:creator>
      <dc:date>2013-04-12T14:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Removing string - in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106512#M29660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;However it worked but in my values there are '-' in middle too those are removing too.&lt;/P&gt;&lt;P&gt;so i just need to remove only the first position of value only For '-'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 14:45:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106512#M29660</guid>
      <dc:creator>muralip2013</dc:creator>
      <dc:date>2013-04-12T14:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Removing string - in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106513#M29661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input v$;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;abc&lt;/P&gt;&lt;P&gt;-bc&lt;/P&gt;&lt;P&gt;a-b&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; v=ifc(first(v)='-',compress(v,'-'),v);&lt;/P&gt;&lt;P&gt;proc print;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 14:51:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106513#M29661</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2013-04-12T14:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Removing string - in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106514#M29662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="3068" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/"&gt;&lt;/A&gt;, very nice;&lt;/P&gt;&lt;P&gt;is the 'ifc" saying if the first character in string V is "-"??&lt;/P&gt;&lt;P&gt;That's awesome!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;Or am I misunderstanding?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Yes, I am misunderstanding...I read on the IFC function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;is the first(v), the FIRST function that tells SAS that if the first character is "-' then so on...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;still neat!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 14:59:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106514#M29662</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-04-12T14:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Removing string - in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106515#M29663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are right.&lt;/P&gt;&lt;P&gt;It is the same as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;if first(v)='-'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; then v=compress(v,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;'-'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 15:04:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106515#M29663</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2013-04-12T15:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Removing string - in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106516#M29664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Lin lin. but when I have "-" in the middle its getting removed too. For instance in the following example for the third value "&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;-a-b&lt;/SPAN&gt;" have "-" at the begining and the middle also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data have;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;input v$;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;cards;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;abc&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;-bc&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;-a-b&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;When I tried the following code,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: #800080;"&gt;if first(v)='-'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff;"&gt; then v=compress(v,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff; color: #800080;"&gt;'-'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;My output is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;abc&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;bc&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ab&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;but the required output is (i.e If there is any "_" in the middle other than first position I need to keep it as is)&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;abc&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;bc&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;a-b&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Please help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 15:16:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106516#M29664</guid>
      <dc:creator>muralip2013</dc:creator>
      <dc:date>2013-04-12T15:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Removing string - in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106517#M29665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry!&lt;/P&gt;&lt;P&gt;try this one.&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input v$;&lt;BR /&gt;cards;&lt;BR /&gt;abcc&lt;BR /&gt;-bcc&lt;BR /&gt;-a-b&lt;BR /&gt;;&lt;BR /&gt;data want;&lt;BR /&gt;&amp;nbsp; set have;&lt;BR /&gt;&amp;nbsp; v=ifc(first(v)='-',substr(v,2),v);&lt;BR /&gt;&amp;nbsp; proc print;run;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Obs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; abcc&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bcc&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a-b&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 15:38:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106517#M29665</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2013-04-12T15:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Removing string - in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106518#M29666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input v$;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;abc&lt;/P&gt;&lt;P&gt;-bc&lt;/P&gt;&lt;P&gt;-a-b&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; v1= prxchange("s/-//i",1,strip(v));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 15:42:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106518#M29666</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-04-12T15:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Removing string - in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106519#M29667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Linlin and Tilea,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank both of you for your help. I really appreciate your input. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please help me with the following one too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data sample:&lt;/P&gt;&lt;P&gt;Set sample;&lt;/P&gt;&lt;P&gt;Amd1_9-;&lt;/P&gt;&lt;P&gt;AMD1_10-;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AMD1_9-History of another malignancy within the previous 5 years other than curatively treated non-&lt;/P&gt;&lt;P&gt;melanomatous skin cancer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AMD1_10-Current or prior treatment with estrogens and/or drugs with anti-androgenic properties such&lt;/P&gt;&lt;P&gt;as spironolactone &amp;gt; 50mg/kg, or progestational agents for the treatment of prostate cancer less than 6&lt;/P&gt;&lt;P&gt;months prior to randomization .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my variable sample I have two sets of values one is 7 char in length second set is 8 char in length&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to just remove up to colon part and my variable should be starting from alphabets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can u Please help me out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 16:28:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106519#M29667</guid>
      <dc:creator>muralip2013</dc:creator>
      <dc:date>2013-04-12T16:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Removing string - in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106520#M29668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if string =: '-' then string = substr(string,2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;won't remove anything except a "-" from the first position.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 16:29:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106520#M29668</guid>
      <dc:creator>OS2Rules</dc:creator>
      <dc:date>2013-04-12T16:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Removing string - in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106521#M29669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;what does the " =: " mean?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anca.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 16:49:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106521#M29669</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-04-12T16:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Removing string - in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106522#M29670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;its&amp;nbsp; working but my last char in word is truncating&lt;/P&gt;&lt;P&gt;ex :fever&lt;/P&gt;&lt;P&gt;as feve&amp;nbsp; .&lt;/P&gt;&lt;P&gt;could u tell me any other way&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 16:51:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106522#M29670</guid>
      <dc:creator>muralip2013</dc:creator>
      <dc:date>2013-04-12T16:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Removing string - in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106523#M29671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Which Colon part?&lt;/P&gt;&lt;P&gt;What do you need?&lt;/P&gt;&lt;P&gt;This is what you have for a variable named &lt;EM&gt;sample&lt;/EM&gt; it takes values amd1_9- and amd1_10-&lt;/P&gt;&lt;P&gt;Sample&lt;/P&gt;&lt;P&gt;Amd1_9-&lt;/P&gt;&lt;P&gt;AMD1_10-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And you want an new variable &lt;EM&gt;new_sample&lt;/EM&gt; to take what values exactly:&lt;/P&gt;&lt;P&gt;New_Sample&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 16:52:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106523#M29671</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-04-12T16:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Removing string - in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106524#M29672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have a variable called &lt;EM&gt;sample &lt;/EM&gt;like this&lt;/P&gt;&lt;P&gt;Sample&lt;/P&gt;&lt;P&gt;Amd1_9-&lt;/P&gt;&lt;P&gt;AMD1_10-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please be more specific what do you need the new variable to look like:&lt;/P&gt;&lt;P&gt;Sample&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And for the other problem with removing the string, why do you need more ways?&lt;/P&gt;&lt;P&gt;what's wrong with what either I or LinLin offered?&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input string$;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;abc&lt;/P&gt;&lt;P&gt;-bc&lt;/P&gt;&lt;P&gt;-a-b&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; string1= prxchange("s/-//i",1,strip(string));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;should work....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 16:54:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106524#M29672</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-04-12T16:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Removing string - in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106525#M29673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Hi Antea,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Following is my data.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Data sample:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Set sample;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Amd1_9-;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;AMD1_10-;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Run;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;AMD1_9-History of another malignancy within the previous 5 years other than curatively treated non-&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;melanomatous skin cancer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;AMD1_10-Current or prior treatment with estrogens and/or drugs with anti-androgenic properties such&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;as spironolactone &amp;gt; 50mg/kg, or progestational agents for the treatment of prostate cancer less than 6&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;months prior to randomization .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I need &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;my new variable sample:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;"History of another malignancy within the previous 5 years other than curatively treated non-&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;melanomatous skin cancer"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 16:59:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106525#M29673</guid>
      <dc:creator>muralip2013</dc:creator>
      <dc:date>2013-04-12T16:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: Removing string - in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106526#M29674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hmmm, something like this:&lt;/P&gt;&lt;P&gt;Data sample;&lt;/P&gt;&lt;P&gt;input sample $50.;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;AMD1_9-History of another malignancy within &lt;/P&gt;&lt;P&gt;AMD1_10-Current or prior treatment with estrogens &lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;proc print;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sample;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; new_sample = prxchange("s/.*[-]//i",1,(sample));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 17:13:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106526#M29674</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-04-12T17:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Removing string - in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106527#M29675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The "=:' sets the length of the right side argument to the length of the left side argument.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So - if the left argument is 1 character, the "=:' will only look at the first character of the right side argument.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very handy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 17:39:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-string-in-the-data/m-p/106527#M29675</guid>
      <dc:creator>OS2Rules</dc:creator>
      <dc:date>2013-04-12T17:39:10Z</dc:date>
    </item>
  </channel>
</rss>

