9.148 NUMERIC_STRING

Note: Built-In Function Rules     Usage Options

Converts a number to a string.

Arguments

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

N

Req

Number to be converted

1

29

0

9

2

A

Opt

Removes trailing zeroes from the decimal portion of the number.
Y = Trim
Default = Trim

1

1

 

 

 

Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Number as a string

1

31

 

 

 

Example

Convert a number to a string for use in QRYSLT of OPEN command

DEFINE     FIELD(#SALARY)  TYPE(*DEC) LENGTH(20) DECIMALS(0)

DEFINE     FIELD(#SALCHR)  TYPE(*CHAR) LENGTH(20)

DEFINE     FIELD(#QRYSLT)  TYPE(*CHAR) LENGTH(256)

**********

REQUEST    FIELDS(#SALARY)

USE        BUILTIN(NUMERIC_STRING) WITH_ARGS(#SALARY)

           TO_GET(#SALCHR)

CHANGE     FIELD(#QRYSLT) TO('''SALARY *GT''')

USE        BUILTIN(BCONCAT) WITH_ARGS(#QRYSLT #SALCHR)

           TO_GET(#QRYSLT)

OPEN       FILE(PAYROLL) USE_OPTION(*OPNQRYF) QRYSLT(#QRYSLT)

 

      < some processing >