<?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: Trailing blank in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Trailing-blank/m-p/633302#M187868</link>
    <description>&lt;P&gt;Please describe what you are doing that "trailing blanks" is causing problems or affecting your analysis.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Mar 2020 15:03:09 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-03-19T15:03:09Z</dc:date>
    <item>
      <title>Trailing blank</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trailing-blank/m-p/633266#M187855</link>
      <description>I have an&lt;BR /&gt;data have;&lt;BR /&gt;Input result $;&lt;BR /&gt;Data lines;&lt;BR /&gt;Abc&lt;BR /&gt;Def&lt;BR /&gt;Hjkkk&lt;BR /&gt;Lkhhhh&lt;BR /&gt;;&lt;BR /&gt;Run;&lt;BR /&gt;I want to remove the trailing blanks&lt;BR /&gt;And want to see in which observation the blank have been removed&lt;BR /&gt;</description>
      <pubDate>Thu, 19 Mar 2020 13:13:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trailing-blank/m-p/633266#M187855</guid>
      <dc:creator>amol2939</dc:creator>
      <dc:date>2020-03-19T13:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Trailing blank</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trailing-blank/m-p/633269#M187858</link>
      <description>&lt;P&gt;You cannot remove trailing blanks from character variables, as they are always padded with blanks to the defined length.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 13:16:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trailing-blank/m-p/633269#M187858</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-19T13:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Trailing blank</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trailing-blank/m-p/633271#M187859</link>
      <description>&lt;P&gt;SAS character variables are fixed length (type CHAR). If you just use $ without a length specification in your input statement then the variable will become character with a length of 8.&lt;/P&gt;
&lt;P&gt;As it's fixed length there are always trailing blanks unless your string is already 8 characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So: Removing trailing blanks is not possible but if you just want to know how long your strings actually are then you can use the length() or lengthn() function.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input result $;
  lenOfString=length(result);
  datalines;
Abc
Def
Hjkkk
Lkhhhh
;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 13:23:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trailing-blank/m-p/633271#M187859</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-03-19T13:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Trailing blank</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trailing-blank/m-p/633290#M187865</link>
      <description>&lt;P&gt;Building upon Kurt's and Patrick's responses.&amp;nbsp; The below code shows what they have said.&amp;nbsp; Now you can compare lenOfString and columnLengthOf_result to see when strip() does something.&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt;input result $;&lt;BR /&gt;retain columnLengthOf_result 0;&lt;BR /&gt;if _n_=1 then columnLengthOf_result=vlength(result); &lt;BR /&gt;lenOfString=length(result);&lt;BR /&gt;Original_result='(' || result || ')';&lt;BR /&gt;Stripped_result='(' || strip(result) ||')';&lt;/P&gt;
&lt;P&gt;datalines;&lt;BR /&gt;Abc&lt;BR /&gt;Def&lt;BR /&gt;Hjkkk&lt;BR /&gt;Lkhhhh&lt;BR /&gt;;;;;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 14:10:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trailing-blank/m-p/633290#M187865</guid>
      <dc:creator>JerryV</dc:creator>
      <dc:date>2020-03-19T14:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: Trailing blank</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trailing-blank/m-p/633302#M187868</link>
      <description>&lt;P&gt;Please describe what you are doing that "trailing blanks" is causing problems or affecting your analysis.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 15:03:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trailing-blank/m-p/633302#M187868</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-03-19T15:03:09Z</dc:date>
    </item>
  </channel>
</rss>

