WebSphere logo Classic Federation Server for z/OS, Version 9.1
WebSphere logo Classic Replication Server for z/OS, Version 9.1
WebSphere logo Classic Data Event Publisher for z/OS, Version 9.1
WebSphere logo Data Integration Classic Connector for z/OS, Version 9.1


Multiple record arrays in a single COBOL copybook

If the record layout for a database contains multiple record arrays, these arrays can all be mapped into a single table, if they are not defined as COBOL OCCURS DEPENDING ON clauses. You should create one table for each record array that you want to map.

A single record in result sets will be the Cartesian product of mapping multiple record arrays in a single table definition. Before you map multiple arrays, be sure that you understand the effects of multiple arrays on result sets.

For example, assume that EMPLOYEE-RECORD includes two OCCURS clauses:
  01  EMPLOYEE-RECORD.
      ...
      05  DEPENDENTS-ARRAY OCCURS 20 TIMES.
      ...
      05  HOBBIES-ARRAY OCCURS 5 TIMES PIC X(10).

If you use the Classic Data Architect COBOL copybook Import facility to create a table definition for this record layout, the facility will, by default, map both the DEPENDENTS-ARRAY and HOBBIES-ARRAY into the same table.

If you map both the DEPENDENTS-ARRAY and HOBBIES-ARRAY into the same table, the result set for a single record will be the Cartesian product of the DEPENDENTS-ARRAY and the HOBBIES-ARRAY, which is 100 rows.

If you need information in both arrays, you should create two tables, and include one of the arrays in each table.

Related concepts
Occurs processing
Record arrays


Feedback

Update icon Last updated: 2006-12-15