Previous Page | Next Page

Functions and CALL Routines

LEFT Function



Left-aligns a character string.
Category: Character
Restriction: I18N Level 0
Tip: DBCS equivalent function is KLEFT in SAS National Language Support (NLS): Reference Guide. See DBCS Compatibility.

Syntax
Arguments
Details
The Basics
DBCS Compatibility
Examples
See Also

Syntax

LEFT(argument)


Arguments

argument

specifies a character constant, variable, or expression.


Details


The Basics

In a DATA step, if the LEFT function returns a value to a variable that has not previously been assigned a length, then that variable is given the length of the argument.

LEFT returns an argument with leading blanks moved to the end of the value. The argument's length does not change.


DBCS Compatibility

The LEFT function left-aligns a character string. You can use the LEFT function in most cases. If an application can be executed in an ASCII environment, or if the application does not manipulate character strings, then using the LEFT function rather than the KLEFT function.


Examples

SAS Statements Results

----+----1----+
a='  DUE DATE';
b=left(a);
put b;
 

DUE DATE


See Also

Functions:

COMPRESS Function

RIGHT Function

STRIP Function

TRIM Function

Previous Page | Next Page | Top of Page