Usage Clause
This clause is allowed for documentary purposes in the REPORT SECTION, for consistency with basic COBOL, or to emphasize that an entry is DBCS.
Usage Clause: Coding Rules
-
The USAGE clause may be coded at any level, but no item may be subject to both USAGE DISPLAY and USAGE DISPLAY-1.
-
DISP is synonymous with DISPLAY.
-
Only non-DBCS items may be subject to USAGE DISPLAY and only DBCS items may be subject to USAGE DISPLAY-1.
-
No other forms of the USAGE clause are permitted in the REPORT SECTION.
Usage Clause: Operation
DISPLAY is retained for consistency with basic COBOL but it is never required.
USAGE DISPLAY-1 indicates that the item (or items if on a group level) is DBCS (Double-Byte Character Set), such as Japanese Kanji. However, it is not required in the REPORT SECTION, since it is implied by the presence of a DBCS PICTURE string (containing the symbols "G" and "B" only) or a DBCS literal, of the form G"so...si" or G'so...si' where so and si are the shift-out and shift-in characters. DBCS items are stored with a shift-out character on the left and a shift-in on the right. Each double-byte character occupies one print column position even though it takes up two bytes of memory. COLUMN numbers (absolute or relative) take this into account. Spaces inserted between DBCS items are the regular (non-DBCS) space.
Compatibility
OS/VS and DOS/VS COBOL Report Writer and new Report Writer treat USAGE DISPLAY identically. OS/VS and DOS/VS COBOL do not handle DBCS fields.