Override considerations to System/36 for DDM
When a file override is issued on the iSeries™ server to get records in a logical file on a System/36™, the results might be different than expected because of the difference in how each system deals with keyed files.
An iSeries server uses access paths and logical files, which produce a single view of a file. A System/36 logical file can be considered a list of keys and relative record numbers.
When an iSeries server accesses a System/36 logical file:
- If you specify a relative record number, you receive the record from the underlying System/36 base file that corresponds to that record number. Then if you request to read the next record, you receive the next sequential record from the base file.
- If you specify a key, you receive the record that corresponds to the first occurrence of that key in the index file. If you request to read the next record, you receive the record that matches the next entry in the index file.
The following example shows the various results for records being retrieved from a System/36 logical file by an iSeries program. The example assumes that:
- File S36FILEA is the base file and S36FILEB is the logical file that is built over the base file.
- Both files have DDM files named S36FILEA and S36FILEB that point to corresponding remote files on the target System/36.
- The key field is numeric and it always contains the record number.
- The records in the base file (S36FILEA) are in ascending sequence by key, and the records in the logical file (S36FILEB) are in descending sequence with the same key.
- To create the results shown in the following table, the POSITION parameter value is shown to vary, and no NBRRCDS parameter is specified on either command (which means the total records read is dependent only on the POSITION parameter value).
OVRDBF FILE(S36FILEA) TOFILE(S36FILEB) POSITION(*RRN ... or *KEY ...) CPYF FROMFILE(S36FILEA) TOFILE(ISERIESFILEB) CRTFILE(*YES) FMTOPT(*NOCHK)Depending on the values specified on the Override with Database File (OVRDBF) command for the POSITION parameter, the following are the resulting records that are copied into the file ISERIESFILEB when it is created on the source iSeries server:
POSITION parameter (See note) Resulting records retrieved *RRN 1 299 records, 1 through 299 *KEY 1 1 record, first record only *RRN 299 1 record, last record only *KEY 299 299 records, 299 through 1 *RRN 150 150 records, 150 through 299 *KEY 150 150 records, 150 through 1 This column assumes only one key field for *KEY values and uses the remote file name as the default value for the record format name.
Parent topic:
System/36 source and target considerations for DDM