<?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: PROC SQL in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Trim-variables-in-PROC-SQL/m-p/313967#M61520</link>
    <description>&lt;P&gt;So, if a character has a set length of 12 but you trim it, it still has a length of 12. Make sure you use, LENGTHN to check the length.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, it can be other invisible characters, you can use a hex format to view your data to check. I think 20 is a space and anything else is a different character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put variable_name $hex.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 24 Nov 2016 05:42:56 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-11-24T05:42:56Z</dc:date>
    <item>
      <title>Trim variables in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trim-variables-in-PROC-SQL/m-p/313947#M61516</link>
      <description>&lt;P&gt;Is there a function or statement that would trim blanks from an imported SQL character variable? e.g. similar to SAS functions STRIP or TRIM.&lt;/P&gt;
&lt;P&gt;For example, if use the following code, STRIP has no impact but it doesn't give an error message either:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc sql;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;select strip(variable_name) as no_blanks&lt;/P&gt;
&lt;P&gt;from xxxx_database;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2016 08:29:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trim-variables-in-PROC-SQL/m-p/313947#M61516</guid>
      <dc:creator>PTD_SAS</dc:creator>
      <dc:date>2016-11-24T08:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trim-variables-in-PROC-SQL/m-p/313958#M61518</link>
      <description>&lt;P&gt;Are these leading or trailing blanks? Are you sure they're blanks?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What makes you think it hasn't worked?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2016 05:05:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trim-variables-in-PROC-SQL/m-p/313958#M61518</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-24T05:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trim-variables-in-PROC-SQL/m-p/313964#M61519</link>
      <description>&lt;P&gt;Thanks for your reply. Your question puzzled me now, I'm not sure they are blanks!, &amp;nbsp;although when I do proc print they look so.&lt;/P&gt;
&lt;P&gt;I created a data set from the SQL statement and used the trim and strip functions in a data statement but looks like the character variables are still the same length with what it looks like a lot of trailing blanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I may have to investigate more...&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2016 05:30:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trim-variables-in-PROC-SQL/m-p/313964#M61519</guid>
      <dc:creator>PTD_SAS</dc:creator>
      <dc:date>2016-11-24T05:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Trim-variables-in-PROC-SQL/m-p/313967#M61520</link>
      <description>&lt;P&gt;So, if a character has a set length of 12 but you trim it, it still has a length of 12. Make sure you use, LENGTHN to check the length.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, it can be other invisible characters, you can use a hex format to view your data to check. I think 20 is a space and anything else is a different character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put variable_name $hex.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Nov 2016 05:42:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Trim-variables-in-PROC-SQL/m-p/313967#M61520</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-24T05:42:56Z</dc:date>
    </item>
  </channel>
</rss>

