ILE COBOL Language Reference

Rules and Restrictions

You can use the LIKE clause at level-numbers 01 through 49, and at level-number 77.

If you specify data-name or FILLER entries, you can put the LIKE clause in any position after them. Otherwise, you can put it in any position after the level-number.

You can specify one or more other clauses before or after the LIKE clause:

Note that you can specify BLANK WHEN ZERO only if it has not previously been inherited.

You cannot use the LIKE clause with the following clauses:

If you specify any inherited clauses in the LIKE clause, a duplication error will result.

For numeric items, the total number of numeric characters in the new item cannot be zero. But if the item contains decimals, the number of characters in the integer portion can be zero.

If a PICTURE clause specifies a mixture of alphabetic, numeric, or alphanumeric characters, and the LIKE clause has length modification, the new PICTURE clause specifies alphanumeric characters.

You cannot use the LIKE clause to define an item that is subordinate to the item that you name in the clause.

The object of a LIKE clause cannot contain the TYPE clause in its data description. If the object of a LIKE clause is a group item, then none of the items subordinate to this group can be defined using the TYPE clause. If the object of a LIKE clause is subordinate to a (level-01) group item, and an item which is subordinate to the level-01 group item contains a TYPE clause, then the type-name referenced in the TYPE clause must be fully defined at the point in the DATA DIVISION when the LIKE clause is used.


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