Previous Topic Next topic Print topic


COBCH1654 Should be elementary; MODE IS BLOCK assumed

You have attempted to perform an ACCEPT or DISPLAY statement on a group item, but have specified an optional phrase that is only applicable to elementary items.

This error only occurs if you are compiling with one of the ACUCOBOL or RM/COBOL dialect Compiler directives. Set the MODE IS BLOCK phrase to make your source code more compatible with this COBOL system. By setting MODE IS BLOCK, the group item is treated as an elementary item.

01 group-01.
   02 field-01      pic x(10).
   02 filler        pic x(02).
   02 field-02      pic x(10).

Procedure division.

accept group-01 auto  *> correct - the auto phrase is allowed for group items
accept group-01 beep  *> incorrect - the beep phrase is not allow for group items
accept group-01 beep MODE IS BLOCK *> correct - the group-01 item is treated as an elementary item (pic x (22))
Previous Topic Next topic Print topic