Changing reserved words

To change the words that Enterprise COBOL treats as reserved, use the reserved word table utility.

The reserved words used by Enterprise COBOL are maintained in a table (IGYCRWT) provided with the product. A CICS-specific reserved word table (IGYCCICS) is provided as an alternate reserved word table (see CICS reserved word table (IGYCCICS)). You can change the reserved words by using the reserved word table utility (IGY8RWTU) to modify IGYCRWT or IGYCCICS, or by creating additional reserved word tables. You can also modify tables that you previously created.

The reserved word table utility accepts control statements to create or modify a reserved word table. The new table then contains the reserved words from the IBM-supplied table with all the changes that you have applied.

You can make the following types of changes to reserved word tables:
  • Add words to be flagged with an informational message whenever they are used in a program. To produce these information messages, you must modify the IGYCRWT reserved word table and compile using the FLAGSTD option.
  • Add words to be flagged with a severe error message whenever they are used in a program.
  • Indicate that words currently flagged with an informational or error message should no longer be flagged.

Each reserved word table that you create must have a unique 1- to 4-character identifier. For a list of character strings that cannot be used, see WORD.

At compile time, the value of the compiler option WORD(xxxx) identifies the reserved word table to be used. xxxx is the unique 1- to 4-character identification that you specified in the member name IGYCxxxx. You can create multiple reserved word tables, but only one can be specified at compile time.

Note: The total number of entries in a reserved word table should not exceed 1536 or 1.5 KB.

Because of the following example, when the IBM® extension reserved word ENTRY is used in a program, it will be flagged with message 0086.


INFO  ENTRY
The following example restricts the use of Boolean, XD, and PARENT. Use of these will cause errors.

RSTR  BOOLEAN
      XD
      PARENT

The following example restricts the use of GO TO and ALTER. Use of these will cause errors.


RSTR  GO
      ALTER

In the following example, the reserved word table generated allows usage of all the 85 COBOL Standard language except nested programs.


RSTR IDENTIFICATION(1)  only allow 1 program per compilation unit
RSTR ID(1)              same for the short form
RSTR PROGRAM-ID(1)      only allow 1 program per compilation unit
RSTR GLOBAL             do not allow this phrase at all