Desktop productivity for business analysts and programmers

Length statement

Reply
Nlr
N/A
Posts: 1

Length statement

Hi!

How do you write the 'length' statement in the expression builder? Can it be used when you have a character column?
Community Manager
Posts: 2,889

Re: Length statement

Are you trying to calculate the length of the character value? If so, you can use an expression like this in your calculated column:

LENGTHC( )

For example, if you want to calculate the length of each Name value in SASHELP.CLASS, use this:

LENGTHC(Name)

If you want to make sure that trailing blanks aren't counted, use this:

LENGTHC(TRIM(Name))

Chris
Ask a Question
Discussion stats
  • 1 reply
  • 264 views
  • 0 likes
  • 2 in conversation