<?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: Length statement in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Length-statement/m-p/221#M53</link>
    <description>Are you trying to calculate the length of the character value?  If so, you can use an expression like this in your calculated column:&lt;BR /&gt;
&lt;BR /&gt;
LENGTHC( &lt;COLUMNNAME&gt; )&lt;BR /&gt;
&lt;BR /&gt;
For example, if you want to calculate the length of each Name value in SASHELP.CLASS, use this:&lt;BR /&gt;
&lt;BR /&gt;
LENGTHC(Name)&lt;BR /&gt;
&lt;BR /&gt;
If you want to make sure that trailing blanks aren't counted, use this:&lt;BR /&gt;
&lt;BR /&gt;
LENGTHC(TRIM(Name))&lt;BR /&gt;
&lt;BR /&gt;
Chris&lt;/COLUMNNAME&gt;</description>
    <pubDate>Fri, 24 Mar 2006 21:19:26 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2006-03-24T21:19:26Z</dc:date>
    <item>
      <title>Length statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Length-statement/m-p/220#M52</link>
      <description>Hi!&lt;BR /&gt;
&lt;BR /&gt;
How do you write the 'length' statement in the expression builder? Can it be used when you have a character column?</description>
      <pubDate>Tue, 21 Mar 2006 12:32:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Length-statement/m-p/220#M52</guid>
      <dc:creator>Nlr</dc:creator>
      <dc:date>2006-03-21T12:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Length statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Length-statement/m-p/221#M53</link>
      <description>Are you trying to calculate the length of the character value?  If so, you can use an expression like this in your calculated column:&lt;BR /&gt;
&lt;BR /&gt;
LENGTHC( &lt;COLUMNNAME&gt; )&lt;BR /&gt;
&lt;BR /&gt;
For example, if you want to calculate the length of each Name value in SASHELP.CLASS, use this:&lt;BR /&gt;
&lt;BR /&gt;
LENGTHC(Name)&lt;BR /&gt;
&lt;BR /&gt;
If you want to make sure that trailing blanks aren't counted, use this:&lt;BR /&gt;
&lt;BR /&gt;
LENGTHC(TRIM(Name))&lt;BR /&gt;
&lt;BR /&gt;
Chris&lt;/COLUMNNAME&gt;</description>
      <pubDate>Fri, 24 Mar 2006 21:19:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Length-statement/m-p/221#M53</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2006-03-24T21:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Length statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Length-statement/m-p/618825#M35413</link>
      <description>&lt;P&gt;If I understand the question correctly, you can either force the length with a put statement:&lt;/P&gt;
&lt;P&gt;put( scan(VAR,1), $32.)&lt;/P&gt;
&lt;P&gt;or (possibly; untested) add the length after the expression&lt;/P&gt;
&lt;P&gt;scan(VAR,1) &amp;nbsp; length = 32&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 11:22:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Length-statement/m-p/618825#M35413</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-01-21T11:22:58Z</dc:date>
    </item>
  </channel>
</rss>

