Defining a multiple projection
When one of your files to read is directly related to two or more files (for example, File A relates to File B and File A relates to File C), you can specify the method in which those secondary files should be processed. The default method is to create detail records that combine data from both secondary files. The multiple projection option enables you to create detail records first from one file, then from the second file, for a given key value in the primary file. Optionally, using a common sort key, you can then merge the records. See Understanding multiple projections for a more detailed explanation.
To define multiple projections, both files must be on the same level, which means that both must be related to the file above them if a tree of relationships were to be drawn. Also, the primary file must have a one-to-many relationship with the related files (for example, one record in File A can relate to multiple records in File B and multiple records in File C).
Before you can define a multiple projection, both of the secondary files must be selected as files to read.
1. | Highlight the second file. |
2. | Select File functions > Multiple projections. In the Multiple Projections window, the Sister file field displays the description of the other file you selected on the same level. See figure 1. |
|
3. | Enter the requested data: |
Read in
The value in this field determines how the current file’s records should be processed in relation to its sister file.
Together = Detail records are created by combining data from this file with data from its sister file. (default)
Separately = Detail records are created from data in this file only after detail records are created for data in the sister file (for a particular key value). If you select this option, an M displays next to the file in the Files to Read window.
4. | Exit the window. |