<?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 Parts of a String: Alternatives to Compress in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Deleting-Parts-of-a-String-Alternatives-to-Compress/m-p/162769#M42274</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Compress you keep using that function, I don't think it means what you think it means.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Compress does not operate at the word level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps TRANSTRN or a regular expression would be better than compress.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Dec 2013 17:12:34 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2013-12-03T17:12:34Z</dc:date>
    <item>
      <title>Deleting Parts of a String: Alternatives to Compress</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Deleting-Parts-of-a-String-Alternatives-to-Compress/m-p/162768#M42273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Cambria','serif';"&gt;Hi-&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Cambria','serif';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN style="font-family: 'Cambria','serif';"&gt;I have a variable called &lt;STRONG&gt;CreativeName&lt;/STRONG&gt; with many different string values. Some of the values (not all) have parts of the strings which need to be deleted. If I use COMPRESS the characters are deleted anywhere in the string; and &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Cambria','serif';"&gt;not the part of the string I specify.&amp;nbsp; The parts that need to be deleted can be found at the beginning or the end of the string value. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Cambria, serif; color: #000000;"&gt;Here are some examples of the strings that need to be cleaned/modified &lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-family: Cambria, serif; color: #000000;"&gt;&lt;STRONG&gt;Yahoo_AS_&lt;/STRONG&gt;acq_fios_3x_NeonLastChanceNAT_8999_AmazonVisa_Flash_10282013_728x90.swf &lt;STRONG&gt;| AK &amp;amp; REVSCI&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-family: Cambria, serif; color: #000000;"&gt;&lt;STRONG&gt;Google_AS_&lt;/STRONG&gt;acq_fios_3x_NeonLastChancePOTOMAC_8999_AmazonVisa_Flash_10282013_728x90.swf &lt;STRONG&gt;| AK &amp;amp; REVSCI&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-family: Cambria, serif; color: #000000;"&gt;acq_fios_3X_MadDashPot_7999_Visa_Flash_11172013_728x90.swf &lt;STRONG&gt;(copy)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-family: Cambria, serif; color: #000000;"&gt;&lt;STRONG&gt;AOL_AS_&lt;/STRONG&gt;acq_fios_3X_SpeedTiersNY_8999_NAC_Flash_1012013_728x90.swf&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Cambria, serif; color: #000000;"&gt;This is what I have: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Cambria, serif; color: #000000;"&gt;Data want; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Cambria, serif; color: #000000;"&gt;Set have; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: Cambria, serif; color: #000000;"&gt;CreativeName= compress(CreativeName,’(Copy)’);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: Cambria, serif; color: #000000;"&gt;CreativeName= compress(CreativeName,’AOD_AS_’);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: Cambria, serif; color: #000000;"&gt;CreativeName= compress(CreativeName,’AOL_AS_’);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: Cambria, serif; color: #000000;"&gt;CreativeName= compress(CreativeName,’Google_AS_’);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: Cambria, serif; color: #000000;"&gt;CreativeName= compress(CreativeName,’Google_’);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: Cambria, serif; color: #000000;"&gt;CreativeName= compress(CreativeName,’Yahoo_AS_’);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: Cambria, serif; color: #000000;"&gt;CreativeName= compress(CreativeName, '| AK &amp;amp; REVSCI');&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: Cambria, serif; color: #000000;"&gt;CreativeName= compress(CreativeName, '| AK'); run; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: #000000; font-family: Cambria, serif;"&gt;Also for values that are ‘FiOS Presents’ I have to add ‘MF’ to the end. Can I use the TRANSWORD function?&amp;nbsp; Any assistance is appreciated.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Dec 2013 17:05:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Deleting-Parts-of-a-String-Alternatives-to-Compress/m-p/162768#M42273</guid>
      <dc:creator>Mgarret</dc:creator>
      <dc:date>2013-12-03T17:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting Parts of a String: Alternatives to Compress</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Deleting-Parts-of-a-String-Alternatives-to-Compress/m-p/162769#M42274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Compress you keep using that function, I don't think it means what you think it means.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Compress does not operate at the word level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps TRANSTRN or a regular expression would be better than compress.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Dec 2013 17:12:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Deleting-Parts-of-a-String-Alternatives-to-Compress/m-p/162769#M42274</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-12-03T17:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting Parts of a String: Alternatives to Compress</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Deleting-Parts-of-a-String-Alternatives-to-Compress/m-p/162770#M42275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Either TRANWRD or TRANSTR work if you want to replace 'FiOS Presents' with 'FiOS Presents MF'. You want to make sure that the resulting length doesn't exceed the current length of the variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I have a problem like this I generally create a new variable that starts with the original value of the problem variable and manipulate that as invariably I create a rule, usually involving a short string such as your |AK, that creates a problem when it replaces unforethought occurences.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Dec 2013 16:10:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Deleting-Parts-of-a-String-Alternatives-to-Compress/m-p/162770#M42275</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-12-04T16:10:33Z</dc:date>
    </item>
  </channel>
</rss>

