ILE COBOL Programmer's Guide

Working-Storage Section

Working-Storage Section

REDEFINES Clause

The existing rules for redefining data also apply to data that contains DBCS characters. When you determine the length of a redefining or redefined data item, remember that each DBCS character is twice as long as an alphanumeric character.

Also, ensure that redefined data items contain the shift control characters when and where necessary.

OCCURS Clause

Use this clause to define tables for storing DBCS data. If you specify the ASCENDING/DESCENDING KEY phrase, COBOL assumes the contents of the table are in the EBCDIC program collating sequence. The shift control characters in mixed data take part in the collating sequence.

For more information about handling tables that contain DBCS characters, see Table Handling--SEARCH Statement.

JUSTIFIED RIGHT Clause

Use the JUSTIFIED RIGHT clause to align DBCS data at the rightmost position of an elementary receiving field. If the receiving field is shorter than the sending field, COBOL truncates the rightmost characters. If the receiving field is longer than the sending field, COBOL pads (fills) the unused space on the left of the receiving field with blanks.

The JUSTIFIED clause does not affect the initial setting in the VALUE clause.

VALUE Clause

You can use mixed literals to specify an initial value for a data item that is not numeric, or to define values for level-88 condition-name entries. DBCS literals should be used to specify initial values for DBCS or DBCS-edited data items.

Any shift control characters in the literal are considered part of the literal's picture string, except when used to continue a new line. When you continue a mixed literal, the compiler does not include the shift-in character in column 71 or 72, or the initial quotation mark (") and shift-out character on the continued line as part of the mixed literal. Make certain, however, that the mixed literal does not exceed the size of the data item specified in the PICTURE clause, otherwise truncation occurs.

DBCS literals can be used to initialize DBCS data items.

When you use literals that contain DBCS characters in the VALUE clause for level-88 condition-name entries, COBOL treats the DBCS characters as alphanumeric. Therefore, follow the rules for specifying alphanumeric data, including allowing a THROUGH option. This option uses the normal EBCDIC collating sequence, but remember that shift control characters in DBCS data take part in the collating sequence.

PICTURE Clause

Use the PICTURE symbol X to define mixed data items and either G or N for DBCS data items. You would define a DBCS data item containing n DBCS characters as

PICTURE G(n) or PICTURE N(n)

A mixed data item containing m SBCS characters, and one string of n DBCS characters would be defined as

PICTURE X(m+2n+2)

You can use all edited alphanumeric PICTURE symbols for mixed data items. The editing symbols have the same effect on the DBCS data in these items as they do on alphanumeric data items. Check that you have obtained the desired results. Pure DBCS data items can only use the B-editing symbol.

RENAMES Clause

Use this clause to specify alternative groupings of elementary data items. The existing rules for renaming alphanumeric data items also apply to DBCS data items.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]