Previous Page | Next Page

SAS Component Language Dictionary

RIGHT



Returns a right-aligned character value
Category: Character

Syntax
Details
See Also

Syntax

rstring=RIGHT(string<,length>);

rstring

contains the right-aligned character string. If rstring already exists, then specifying a length in the RIGHT function changes the current length of rstring to length. If the length has not been defined with a DECLARE or LENGTH statement, and if rstring is not a window variable, then the default SCL variable length is 200 characters.

Type: Character

string

is the character string to be right-justified.

Type: Character

length

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

Type: Numeric


Details

The string is justified by padding with leading spaces. The default length is the maximum length of rstring characters.

In order for RIGHT to work properly when rstring is a window variable, set the justification attribute (JUST) for rstring to NONE when you define the window variables.

To left-justify a character string, use the LEFT function when you define the window variable. To center a character string, use CENTER.


See Also

CENTER

LEFT

Previous Page | Next Page | Top of Page