Sei sulla pagina 1di 4

Access Path

Definition: The description of an externally described file contains the access path; it describes how records are to be retrieved from the file. Records can be retrieved based on the types of access path. Types of access path: Arrival sequence access path Keyed-sequence access path Arrival sequence access path: The arrival sequence access path is based on the order in which the records are stored in the file. Records are added to the file one after another. If you do not specify a key field for a logical file, the file you are defining has an arrival sequence access path. A** LOGICAL CUSMSTL CUSTOMER MASTER FILE A UNIQUE A R CUSREC PFILE (CUSMSTP) A TEXT ('Customer Master Record') A CUST A NAME A ADDR

Keyed-sequence access path: For the keyed-sequence access path, the sequence of records in the file is based on the contents of the key field that is defined in the DDS for the file. For example, in the DDS shown below CUST is defined as the key field. The keyed-sequence access path is updated whenever records are added, deleted, or when the contents of a key field change. A** LOGICAL CUSMSTL CUSTOMER MASTER FILE A UNIQUE A R CUSREC PFILE (CUSMSTP) A TEXT ('Customer Master Record') A CUST A NAME A ADDR A K CUST

Access path maintenance The MAINT parameter specifies how access paths are maintained for closed files. While a file is open, the system maintains the access paths as changes are made to the data in the file. Immediate maintenance(*IMMED): The access path is updated each time a record is changed, added, or deleted from a member. *IMMED must be specified for files that require unique keys. Rebuild maintenance(*REBLD): The access path is completely rebuilt each time a file member is opened. The access path is maintained until the member is closed; then the access path is deleted. *REBLD cannot be specified for files that require unique keys. Delayed maintenance(*DLY): The maintenance of the access path is delayed until the physical file member is opened for use. Then, the access path is changed only for records that have been added, deleted, or changed since the file was last opened. While the file is open, changes made to its members are immediately reflected in the access paths of those members, no matter what is specified for MAINT. *DLY is not valid for access paths that require unique key values.

Access path recovery: It is used for the files with immediate or delayed access path maintenance, when recovery processing of the file is performed if the access path is being changed when a system failure occurs. This parameter is valid only for a file with a keyed access path. Initial program load(*IPL):

The access path of the file is rebuilt during the IPL operation. This ensures that the file's access path Is rebuilt before the first user program tries to use it; however, no jobs can start running until after all files that specify RECOVER (*IPL) have their access paths rebuilt.

After Initial program load(*AFTIPL):

The access path of the file is rebuilt after the initial program load (IPL) operation is completed. This option allows other jobs not using this file to start processing immediately after the completion of the IPL. *AFTIPL is the default for all files that require unique keys.

Force access path It is specified for the files with key fields, whether access path changes are forced to auxiliary storage along with the associated records in the file. FRCACCPTH (*YES) minimizes (but does not remove) the possibility that an abnormal job end may cause damage to the access path that requires it to be rebuilt.

Using Existing Access path:

When two or more files are based on the same physical files and the same key fields in the same order, they automatically share the same keyed sequence access path. When access paths are shared, the amount of system activity required to maintain access paths and the amount of auxiliary storage used by the files is reduced. When a logical file with a keyed sequence access path is created, the system always tries to share an existing access path.

The owner of any access path is the logical file member that originally created the access path. For a shared access path, if the logical member owning the access path is deleted, the first member to share the access path becomes the new owner. The FRCACCPTH, MAINT, and RECOVER parameters on the Create Logical File (CRTLF) command need not match the same parameters on an existing access path for that access path to be shared. When an access path is shared by several logical file members, and the FRCACCPTH, MAINT, and RECOVER parameters are not identical, the system maintains the

access path by the most restrictive value for each of the parameters specified by the sharing members. The following illustrates how this occurs:

Thus the way in which the records can be retrieved from a file is described by access path.

Potrebbero piacerti anche