Describing access paths for logical files
You can specify the access path for a logical file in several ways.
When you define a record format for a logical file that shares key field specifications of another file's access path (using the DDS keyword, REFACCPTH), you can use any fields from the associated physical file record format. These fields do not have to be used in the file that describes the access path. However, all key and select/omit fields used in the file that describes the access path must be used in the new record format.
- Keyed sequence access path specification. Specify key fields after the last record or field-level specification. The key field names must be in the record format. For join logical files, the key fields must come from the first, or primary, physical file.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 A R CUSRCD PFILE(CUSMSTP) A K ARBAL A K CRDLMT A
- Encoded vector access path specification. You define the encoded vector access path with the SQL CREATE INDEX statement.
- Arrival sequence access path specification. Specify no key fields. You can specify only one physical file on the PFILE keyword (and only one of the physical file's members when you add the logical file member).
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 A R CUSRCD PFILE(CUSMSTP)
- Previously defined keyed-sequence access path specification (for simple and multiple-format logical files only). Specify the REFACCPTH keyword at the file level to identify a previously created database file whose access path and select/omit specifications are to be copied to this logical file. You cannot specify individual key or select/omit fields with the REFACCPTH keyword.
Even though the specified file's access path specifications are used, the system determines which file's access path, if any, will actually be shared. The system always tries to share access paths, regardless of whether the REFACCPTH keyword is used.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 REFACCPTH(DSTPRODLIB/ORDHDRL) A R CUSRCD PFILE(CUSMSTP)
- Selecting and omitting records for logical files
You can select and omit records for a logical file. This helps exclude records from a file for processing convenience or for security.
- Sharing existing access paths between logical files
When two or more logical files are based on the same physical files with the same key fields in the same order, they automatically share the same keyed sequence access path.
Parent topic:
Setting up logical files
Related reference
CREATE INDEX