Complex file load options
If you define columns that contain arrays, you must specify how the Complex Flat File stage should process the array data.
The Complex File Load Option window opens when you load or type column definitions that contain arrays on the Records tab. This window displays the names of the column definitions and their structure. Array sizes are shown in parentheses. Select one of the following options to specify how the stage should process arrays:
- Flatten selective arrays. Specifies that arrays can be selected for flattening on an individual basis. This option is the default. Right-click an array in the columns list and select Flatten from the pop-up menu. Columns that cannot be flattened are not available for selection. The array icon changes for the arrays that will be flattened.
- Flatten all arrays. Flattens all arrays and creates a column for each element of the arrays.
- As is. Passes arrays with no changes.
If you choose to pass an array as is, the columns with arrays are loaded as is.
If you choose to flatten an array, all elements of the array will appear as separate columns in the table definition. The data is presented as one row at run time. Each array element is given a numeric suffix to make its name unique.
Consider the following complex flat file structure (in COBOL file definition format):
05 ID PIC X(10)
05 NAME PIC X(30)
05 CHILD PIC X(30) OCCURS 5 TIMES
Flattening the array results in the following column definitions:
05 ID PIC X(10)
05 NAME PIC X(30)
05 CHILD PIC X(30)
05 CHILD_2 PIC X(30)
05 CHILD_3 PIC X(30)
05 CHILD_4 PIC X(30)
05 CHILD_5 PIC X(30)
A parallel array is flattened in the same way.
Array columns that have redefined fields or OCCURS DEPENDING ON clauses cannot be flattened. Even if you choose to flatten all arrays in the Complex File Load Option window, these columns are passed as is.