Chapter Contents

Previous

Next
LEFT

LEFT



Returns a left-aligned character string

Category: Character


Syntax
Details
See Also

Syntax

lstring=LEFT(string<,length>);

lstring
contains the left-aligned character string. If lstring already exists, then specifying a length in the LEFT function affects the current length of lstring only if the specified length is less than the trimmed length of the string.

Type: Character

string
is the character string to be left-justified.

Type: Character

length
is the length in which the character string is to be left-justified. The default is the maximum length of lstring.

Type: Numeric


Details

Any leading blanks in the string are removed so that the first character in the string is nonblank. The default length of the returned value is the trimmed length of the left-aligned string. Use length to specify a different maximum length for the returned string.

In order for LEFT to work properly when lstring is a window variable, set the justification field (JUST) in the field attribute window for lstring to NONE.

To right-justify a character string, use RIGHT. To center a character string, use CENTER.

See Also

RIGHT

CENTER


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.