Reserved Words

In Visual COBOL, setting certain Compiler directives (such as RM and ANS85) activates certain reserved words that you cannot use as names for your data items.

If you attempt to use a reserved word, you receive a COBCH0666 ("Reserved word used as data name or unknown data description qualifier") COBOL syntax error.

To continue to use the reserved word as a data name, you can:

  • Use the REMOVE Compiler directive, to unreserve that particular keyword.
  • Set the MFLEVEL Compiler directive to an appropriate level, to unreserve all keywords above that level.

    See Compiler Directives in the product Help.

Example

Your RM/COBOL source program may contain the following lines of code:

     .... 
     03 sort   pic 99. 
     .... 
     move 1 to sort

If you submit this to Visual COBOL, you will receive an error because the SORT verb is reserved. However, if you specify the REMOVE"SORT" Compiler directive when you submit this source program, you will not receive the error.