O'Reilly logo

SAS Functions by Example, Second Edition, 2nd Edition by Ron Cody

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Functions That Remove Blanks from Strings

There are times when you want to remove blanks from the beginning or end of a character string. The two functions LEFT and RIGHT merely shift the characters to the beginning or the end of the string, respectively. The TRIM, TRIMN, and STRIP functions are useful when you want to concatenate strings (although the concatenation functions will do this for you).

LEFT and RIGHT

These two functions left- or right-align text. Remember that the length of a character variable will not change when you use these two functions. If there are leading blanks, the LEFT function will shift the first non-blank character to the first position and move the extra blanks to the end; if there are trailing blanks, the RIGHT ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required