PHONTEST: COBOL source file that tests the PHONALL entry point for the PHONETIC subroutine.
TESTPHON: Test program demonstrating PHONETIC encoding process. COBOL source also available.
Mh3>Programmer Instructions Accepts three arguments, returning a four-character conversion of the text string passed to it. This encoded value represents the sounds of the text, and typically includes non-ASCII elements.
The PHONETIC subroutine must be linked to a program through the Wang LINKER. The subroutine has two entry points: PHONETIC, which does not encode the first letter of the character string, and PHONALL, which encodes all elements. The method of using each is described in the example below.
The subroutine requires the following information:
Input PIC X(?) Text to be encoded. A maximum of 16 characters will be encoded. Length set by the optional length argument (next).There is no return code from the subroutine.Length INTEGER Optional; may be omitted. Sets the length of the input text. Defaults to 16.
Output PIC X(04) Encoded value of text string returned by PHONETIC.
CALL "PHONETIC" USING LAST-NAME LAST-NAME-LENGTH PHONETIC-CODE.If you wish to use the PHONALL encoding, the code would look like this:
CALL "PHONALL" USING LAST-NAME LAST-NAME-LENGTH PHONETIC-CODE.Note that the PHONETIC version always preserves the value of the first letter, while PHONALL encodes all elements.