Use this file-level keyword to indicate that the selection and omission tests specified in the file (using select/omit specifications) are done at processing time. This keyword specifies dynamic select/omit rather than access path select/omit.
This keyword has no parameters.
When your program does input operations to a logical file with the DYNSLT keyword specified, all the records in the associated physical file are tested by the system to see if they satisfy the select/omit values. Only those records that satisfy the values are supplied to your program. The testing of each record can result in slower I/O performance, but can be more efficient than maintaining an access path for the file. This is particularly likely for files read only occasionally, especially when the physical files they are based on are updated frequently. Using dynamic select/omit is probably also more efficient for files with a high percentage of selected records.
In keyed sequence access files, an access path is created at file creation time and is maintained for the file according to the MAINT parameter on the Create Logical File (CRTLF) or Change Logical File (CHGLF) command. The DYNSLT keyword does not affect the maintenance of access paths for keyed sequence access files.
For all single-format logical files with a DYNSLT keyword, you do not need to specify key fields in order to specify select/omit fields. However, for all multiple-format logical files with a DYNSLT keyword, you do need to specify at least one key field. You can specify *NONE for this key field.
You cannot specify the DYNSLT keyword with the REFACCPTH keyword.
For a join logical file, the select/omit fields can occur in any of the physical files specified on the JFILE keyword. Use the JREF keyword in join logical files to qualify the origin of the field and resolve any ambiguities.
The following examples show how to specify the DYNSLT keyword.
The following example shows how to specify dynamic select with arrival sequence.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A DYNSLT 00020A R RECORD1 PFILE(PF1) 00030A FLD1 00040A FLD2 00050A S FLD1 COMP(GT 2)
The DYNSLT keyword is required because there are no key fields.
The following example shows how to specify dynamic select with keyed sequence access path.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A DYNSLT 00020A R RECORD1 PFILE(PF1) 00030A FLD1 00040A FLD2 00050A K FLD1 00060A S FLD2 COMP(GT 'bbbb') A
The following example shows how to specify a join logical file with select/omit comparing fields from two physical files.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A DYNSLT 00020A R RECORD1 JFILE(PF1 PF2) 00030A J JFLD(FLD1 FLD3) 00040A FLD1 JREF(PF1) 00050A FLD2 JREF(PF1) 00060A FLD3 JREF(PF2) 00070A FLD4 JREF(PF2) 00080A S FLD1 COMP(GT FLD4) A
FLD1 and FLD2 come from the primary file (PF1), and FLD3 and FLD4 come from the secondary file (PF2). The select specification compares FLD1 from the primary file with FLD4 from the secondary file. Therefore, the DYNSLT keyword is required.
The following example shows how to specify a join logical file with select and omit using fields from more than one physical file.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A DYNSLT 00020A R JREC JFILE(PF1 PF2) 00030A J JOIN(PF1 PF2) 00040A JFLD(FLD1 FLD2) 00050A FLD1 JREF(PF1) 00060A FLD2 JREF(PF1) 00070A FLD3 JREF(PF2) 00080A K FLD1 00090A S FLD1 COMP(GT 0) 00100A O FLD3 COMP(GT 4) A
FLD1 and FLD3 come from different physical files and are specified in a mixture of select and omit statements. Therefore, the DYNSLT keyword is required.