<?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: Tricky Blanks in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Tricky-Blanks/m-p/91438#M26079</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This did the trick!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not going to pretend like I understand what a carriage return is but that seemed to be the case. Your troublesome_characters code above returned a blank value for the blanks that &lt;EM&gt;were &lt;/EM&gt;being erased, and "0D" for those that weren't. I looked up "0D" and that appears to be a carriage return. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I wrote the following code to fix the issue. Please feel free to suggest a more efficient way of doing it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if comment ne '';&amp;nbsp;&amp;nbsp; &amp;lt;== &lt;/EM&gt;Eliminates the normal blanks&lt;/P&gt;&lt;P&gt;&lt;EM&gt;trouble = put(compress(comment), $hex6.); &amp;lt;== &lt;/EM&gt;Identifies carriage returns (blanks where trouble="0D")&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if trouble ne '0D';&amp;nbsp; &amp;lt;== &lt;/EM&gt;Eliminates carriage returns&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Everyone was so helpful. Thank you very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Dec 2012 18:58:06 GMT</pubDate>
    <dc:creator>keeks137</dc:creator>
    <dc:date>2012-12-05T18:58:06Z</dc:date>
    <item>
      <title>Tricky Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Tricky-Blanks/m-p/91434#M26075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey everyone! Completely new here. Thank you in advance for the help. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can not for the life of me figure out why I can't eliminate records that are blank in a certain variable from my data pull. I'm trying to eliminate all records that leave the "comment" field (a text variable) blank by using this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if comment ne '';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was still seeing blanks show up in my data, so I figured there were some records where people just entered a space or tab, and therefore SAS didn't consider them blank. I tried the following two solutions (separately) to eliminate those records:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;clean_comment=strip(comment);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if clean_comment ne '';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;clean_comment=compbl(comment);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if clean_comment ne '';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I'm still seeing the blanks show up. Is there a way I can figure out why those pesky blanks aren't dropping out?&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 18:17:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Tricky-Blanks/m-p/91434#M26075</guid>
      <dc:creator>keeks137</dc:creator>
      <dc:date>2012-12-05T18:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Tricky Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Tricky-Blanks/m-p/91435#M26076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not missing(comment);&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;if not missing(compress(comment));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that doesn't work, you can attach a sample of your excel file just a few of the comment fields to test.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 18:26:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Tricky-Blanks/m-p/91435#M26076</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-12-05T18:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Tricky Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Tricky-Blanks/m-p/91436#M26077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if comment=' ' then delete;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 18:26:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Tricky-Blanks/m-p/91436#M26077</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-12-05T18:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: Tricky Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Tricky-Blanks/m-p/91437#M26078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Most likely, you have diagnosed the problem correctly.&amp;nbsp; There is something nonblank in there, like a tab or a carriage return.&amp;nbsp; It displays as a blank, but it isn't actually a blank so any statement that removes blanks will not remove it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first step is to diagnose what is really in there.&amp;nbsp; Take a few troublesome lines and try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;troublesome_characters = put(compress(comment), $hex6.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then print the troublesome_characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That should give enough information to diagnose what the characters are.&amp;nbsp; Once that it is known, removing them will be relatively simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 18:31:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Tricky-Blanks/m-p/91437#M26078</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-12-05T18:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Tricky Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Tricky-Blanks/m-p/91438#M26079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This did the trick!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not going to pretend like I understand what a carriage return is but that seemed to be the case. Your troublesome_characters code above returned a blank value for the blanks that &lt;EM&gt;were &lt;/EM&gt;being erased, and "0D" for those that weren't. I looked up "0D" and that appears to be a carriage return. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I wrote the following code to fix the issue. Please feel free to suggest a more efficient way of doing it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if comment ne '';&amp;nbsp;&amp;nbsp; &amp;lt;== &lt;/EM&gt;Eliminates the normal blanks&lt;/P&gt;&lt;P&gt;&lt;EM&gt;trouble = put(compress(comment), $hex6.); &amp;lt;== &lt;/EM&gt;Identifies carriage returns (blanks where trouble="0D")&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if trouble ne '0D';&amp;nbsp; &amp;lt;== &lt;/EM&gt;Eliminates carriage returns&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Everyone was so helpful. Thank you very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 18:58:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Tricky-Blanks/m-p/91438#M26079</guid>
      <dc:creator>keeks137</dc:creator>
      <dc:date>2012-12-05T18:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Tricky Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Tricky-Blanks/m-p/91439#M26080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good work!&amp;nbsp; I promise, posters here appreciate when you take the initiative and run with it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest a slightly different route:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;comment = compress(comment, '0D'x);&lt;/P&gt;&lt;P&gt;if comment ne ' ';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That way, you also remove any carriage returns that appear at the end of nonblank comments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on how the data gets read in initially, there may be ways to eliminate the carriage returns earlier in the process.&amp;nbsp; But that's another story.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 19:05:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Tricky-Blanks/m-p/91439#M26080</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-12-05T19:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Tricky Blanks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Tricky-Blanks/m-p/91440#M26081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or using peal regular expression can take care of more "blank character".&lt;/P&gt;&lt;P&gt;comment=prxchange('s/\s+//o',comment,-1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 02:42:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Tricky-Blanks/m-p/91440#M26081</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-12-06T02:42:56Z</dc:date>
    </item>
  </channel>
</rss>

