9.128 LEFT

Note: Built-In Function Rules     Usage Options

Left 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 left 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 left align string

1

256

 

 

 

Example

Left 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(LEFT) WITH_ARGS(#INTEXT Y) TO_GET(#OUTEXT)

DISPLAY    FIELDS(#OUTEXT)

Resulting displays would look something like the following.

        FUN01          Left Example         

*                                               

        In text . . .    FR   E    D        

*                                              

        CF1=Help                             

*                                              

then,

        FUN01          Left Example         

*                                               

        Out text . . . FRED                 

*                                               

        CF1=Help                             

*