500-STRING-NUMERIC

500-STRING-NUMERIC finds the beginning of an input string by ignoring leading zeros; adds parentheses, a percent sign, or both, based on switches set at call; and concatenates the processed string into WS-STRFLD-OUT . No error indication is given when the results are truncated.

Library STRRTNS
Input

WS-STRFLD-IN

WS-STRFLD-IN-LIT-LEN (optional)

WS-STRFLD-IS-ALPHA (optional)

WS-STRFLD-PARENS-FLAG

WS-STRFLD-PERCENT-FLAG

WS-STRFLD-PNTR

Output

WS-STRFLD-IN-GRP (all input control fields are reinitialized)

WS-STRFLD-OUT (always set)

Programming Example

*      Set negative amount in parentheses with zero suppress.
       MOVE 1                        TO WS-STRFLD-PNTR.
       MOVE negative-amount          TO WS-STRFLD-IN.
       MOVE 15                       TO WS-STRFLD-IN-LIT-LEN.
       SET STRFLD-NEEDS-PARENS       TO TRUE.
       PERFORM 500-STRING-NUMERIC.