<?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 Strip Function Results in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Strip-Function-Results/m-p/240312#M14960</link>
    <description>&lt;P&gt;In the SAS 9.4 documentation for Strip, under Details,&amp;nbsp;I noticed this sentence:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If the value that is trimmed is shorter than the length of the receiving variable, SAS pads the value with new trailing blanks.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone show me this in action?&amp;nbsp; I would like to avoid this since it seems to go against what the Strip function is for.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 21 Dec 2015 20:27:08 GMT</pubDate>
    <dc:creator>bzh</dc:creator>
    <dc:date>2015-12-21T20:27:08Z</dc:date>
    <item>
      <title>Strip Function Results</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Strip-Function-Results/m-p/240312#M14960</link>
      <description>&lt;P&gt;In the SAS 9.4 documentation for Strip, under Details,&amp;nbsp;I noticed this sentence:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If the value that is trimmed is shorter than the length of the receiving variable, SAS pads the value with new trailing blanks.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone show me this in action?&amp;nbsp; I would like to avoid this since it seems to go against what the Strip function is for.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2015 20:27:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Strip-Function-Results/m-p/240312#M14960</guid>
      <dc:creator>bzh</dc:creator>
      <dc:date>2015-12-21T20:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Strip Function Results</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Strip-Function-Results/m-p/240314#M14962</link>
      <description>&lt;P&gt;A simple example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if gender='F' then desc = 'Female';&lt;/P&gt;
&lt;P&gt;else desc='Male';&lt;/P&gt;
&lt;P&gt;desc = strip(desc);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first statement defines DESC as being 6 characters long.&amp;nbsp; If the last statement encounters "Male", that won't change the length of DESC.&amp;nbsp; It will contain 6 characters:&amp;nbsp; "Male" plus two trailing blanks.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2015 20:32:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Strip-Function-Results/m-p/240314#M14962</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-12-21T20:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Strip Function Results</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Strip-Function-Results/m-p/240315#M14963</link>
      <description>&lt;P&gt;It depends on what you're trying to do...certain things exclude trailing blanks by default, the length function is a good example. Note the differences between the length and lengthc variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
length var1 $12. var2 $8.;

var2='Cat';
var2_lengthc=lengthc(var2);
var2_length=length(var2);
var1=strip(var2);
var1_lengthc=lengthc(var1);
var1_length=length(var1);
run;

proc print data=have;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;                              var2_      var2_     var1_      var1_
                                 Obs    var1    var2    lengthc    length    lengthc    length

                                  1     Cat     Cat        8          3         12         3
&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Dec 2015 20:33:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Strip-Function-Results/m-p/240315#M14963</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-21T20:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: Strip Function Results</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Strip-Function-Results/m-p/240322#M14965</link>
      <description>&lt;P&gt;Astounding - in your example, if I were to make a Where clause for Male, would it be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where name='Male'&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;where name='Male&amp;nbsp; '&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I may be confused on whether or not these trailing blanks just take up storage or if they affect functionality.&amp;nbsp; If one has a varchar type column with strings of varying length, it sounds like the shorter values will always have trailing blanks in a SAS data set because the Length must be set on the longest value (to avoid truncation).&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2015 21:04:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Strip-Function-Results/m-p/240322#M14965</guid>
      <dc:creator>bzh</dc:creator>
      <dc:date>2015-12-21T21:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Strip Function Results</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Strip-Function-Results/m-p/240325#M14966</link>
      <description>&lt;P&gt;You could use either.&amp;nbsp; The software recognizes when it is comparing strings of unequal length.&amp;nbsp; Without changing any of the values of your variables, it will automatically pad the shorter string with blanks as needed in order to make the comparison.&amp;nbsp; Conveniently, you don't have to add the blanks but you will get the same results.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2015 21:07:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Strip-Function-Results/m-p/240325#M14966</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-12-21T21:07:18Z</dc:date>
    </item>
  </channel>
</rss>

