9.186 RIGHT

Note: Built-In Function Rules     Usage Options

Right aligns argument into return string.

Arguments

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

String to be right align

1

256

 

 

2

A

Opt

Remove imbedded blanks flag (Y/N)

Values:

Y = remove

N = do not remove

Default: N

1

1

 

 

 

Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Return right aligned string

1

256

 

 

 

Example

Right align and remove imbedded blanks from a requested string.

DEFINE     FIELD(#INTEXT)  TYPE(*CHAR) LENGTH(18)

DEFINE     FIELD(#OUTEXT)  TYPE(*CHAR) LENGTH(18)

**********

REQUEST    FIELDS(#INTEXT)

USE        BUILTIN(RIGHT) WITH_ARGS(#INTEXT Y) TO_GET(#OUTEXT)

DISPLAY    FIELDS(#OUTEXT)

Resulting displays would look something like this:

 

        FUN01          Right Example        

                                               

        In text . . .     FR   E     D      

                                              

        CF1=Help                             

                                              

then,

 

        FUN01          Right Example         

                                                

        Out text . . .                   FRED

                                                

        CF1=Help