OCCURS Clause

An OCCURS clause requires special handling, because the compiler must assign a unique name to each database column. The compiler accomplishes this by appending sequential index numbers to the items named in the OCCURS.

For example, if the following were part of a file's description:

     03  employee-table occurs 20 times.
         05  employee-number     pic 9(3)

these column names would be created in the COBOL database table, that is, the table of COBOL data created when AcuXDBC performs its translation:

employee_number_1
employee_number_2
.
.
.
employee_number_10
employee_number_11
.
.
.
employee_number_20

You can use the SUBTABLE directive to modify this behavior, resulting in the compiler storing just the base name along with the name of the subtable specified by the directive.

Note that the hyphens in the COBOL code are translated to underscores in database field names, and the index number is preceded by an underscore.