500-STRING-FIELD

500-STRING-FIELD finds the beginning and ending of an input string by ignoring leading and trailing blanks; adds parentheses, a percent sign, or both, based on input parameter switches set at call; and concatenates the processed string from WS-STRFLD-IN into WS-STRFLD-OUT . If WS-STRFLD-IS-ALPHA is set to Y, leading zeros are not removed. 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.
       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-FIELD.