Handling display errors

If a user who attempts to display a report finds that the report has several display control characters in it, data in one or more of the table columns from which the report is derived might be binary (rather than character) data. QMF provides three ways of handling these control characters:

Using the HEX function

The HEX function is an SQL scalar function that converts its argument to a string of legitimate characters. The resulting string is the value of the argument in hexadecimal notation. For example, the function argument ABC produces the string C1C2C3 in hexadecimal notation.

Instruct users to use the word HEX in their queries in front of any columns that might contain binary data. For example, the following statement converts binary data in column A of the table SMITH.TABLEA.

SELECT HEX(A) FROM SMITH.TABLEA

Using QMF-provided HEX and bit edit codes

Two edit codes (and their wrapping versions) allow QMF to display binary data in character columns: X and XW (for HEX display), B and BW (for bit display). For more information on using these edit codes, see the QMF Reference manual.

Handling binary data with user-written edit routines

Using the HEX function or the HEX and bit edit codes can be a good way to handle binary data. For example, assume that each bit represents a data item and displays in Natural Language Form of the value. If the fifth bit represents gender rather than HEX values, a user edit code routine can cause a value of Male Or Female to be displayed.

You can create your own edit code and write an edit exit routine in COBOL, PL/I, or assembler to convert the binary data to the character string you want. You might consider predefining some QMF forms for users that use the new edit codes you create. See Creating Your Own Edit Codes for QMF Forms for more information.

[ Previous Page | Next Page | Contents | Index ]