580-STRING-TELEPHONE

580-STRING-TELEPHONE strings the input data into the output area as (999)999-9999. No error indication is given for an invalid telephone number. If the area code is 0, the number is strung as 999-9999. If the telephone prefix is 0, no data moves to output.

Library STRRTNS
Input WS-STRFMT-TELEPHONE
Output

WS-STRFLD-OUT (optional)

WS-STRFLD-PNTR (set to next available character position in output)

Programming Example

*       Edit the telephone number.
        MOVE telephone-number        TO WS-STRFMT-TELEPHONE.
        PERFORM 580-STRING-TELEPHONE.