How To
Summary
This document describes the intent of the dynamic LNKLST facility, discusses the risks associated with the LNKLST UPDATE parameter, and provides examples of the use of dynamic LNKLST processing.
Steps
References
Information about dynamic LNKLST processing can be found in:
- z/OS MVS Initialization and Tuning Reference (PROGxx)
- z/OS MVS System Commands (SETPROG)
- MVS Programming: Authorized Assembler Services Guide (Changing the LNKLST Concatenation)
Background
Dynamic LNKLST processing was introduced in the 1990's as a vehicle for allowing the dynamic addition of a new product that required new data sets in the LNKLST. Dynamic LNKLST processing provides the capability to define a new LNKLST concatenation (referred to as a "LNKLST set") and to activate that LNKLST set such that it becomes the "current" LNKLST set on the system. As the current LNKLST set, any newly starting jobs use that LNKLST set; jobs that existed before the dynamic activation of this new current LNKLST set are unaffected. A LNKLST set that is in use by at least one job is said to be "active".
Simple Example
Following is an example of a simple application of dynamic LNKLST processing that uses the SETPROG system command:
SETPROG LNKLST,ADD,NAME=MYLNKLST,DSN=MY.NEW.DATASET
SETPROG LNKLST,ACTIVATE,NAME=MYLNKLST
- The first SETPROG LNKLST statement defines the name of a new LNKLST set, MYLNKLST, and indicates that this new LNKLST set's data set concatenation is identical to that of the current LNKLST. This statement only defines a new LNKLST set. It does not activate that LNKLST set.
- The second SETPROG LNKLST statement adds a data set, MY.NEW.DATASET, to the data set concatenation in the new LNKLST set, MYLNKLST.
- The third SETPROG LNKLST statement activates the new LNKLST set, MYLNKLST, making it the new current LNKLST. Any new jobs started on the system will use LNKLST set MYLNKLST. All jobs active on the system before the activation of LNKLST set MYLNKLST remain unaffected.
Use of system ENQ by Dynamic LNKLST processing
Dynamic LNKLST processing does an allocation for each LNKLST data set, resulting in a SYSDSN (data set) ENQ on each data set. (These ENQs are maintained from the XCFAS address space.) The ENQ has the benefit of preventing modification to a data set in an active LNKLST set, providing the data set was allocated with attribute DISP=OLD. This protection is important since modification of a LNKLST data set carries risk and should be avoided. However, the ENQ has the side effect of preventing normal system maintenance activity from occurring on an uncataloged data set with the same data set name but residing on a different volume. For this reason, dynamic LNKLST processing provides the UNALLOCATE parameter to give the ability to temporarily remove the ENQs and the ALLOCATE parameter to reinstate the ENQs. For example:
[Perform activities on identically named, uncataloged, non-LNKLST data sets on other volumes.]
SETPROG LNKLST,ALLOCATE
Risk in manipulating the LNKLST
Changing a job's LNKLST set
SETPROG LNKLST,ADD,NAME=MYLNKLST,DSN=MY.NEW.DATASET
SETPROG LNKLST,ACTIVATE,NAME=MYLNKLST
SETPROG LNKLST,UPDATE,JOB=MYJOB
Following are the steps for making such a change to all jobs on the system:
SETPROG LNKLST,DEFINE,NAME=MYLNKLST,COPYFROM=CURRENT
SETPROG LNKLST,ADD,NAME=MYLNKLST,DSN=MY.NEW.DATASET
SETPROG LNKLST,ACTIVATE,NAME=MYLNKLST
SETPROG LNKLST,UPDATE,JOB=*
Even when willing to assume the documented risks, it is important to understand what is acceptable practice and what is not acceptable when it comes to managing the LNKLST dynamically. There is sometimes a need on test systems to swap a LNKLST data set, replacing an older version of a LNKLST data set with a newer one of the same name. Following is an example of how NOT to do such a data set swap:
As a result of this command sequence, the following actions occurred:
- The current LNKLST set was unallocated in order to remove its ENQ against LNKLST data set MY.LNKLST.DATASET.
- The MVS™ Library Lookaside facility (LLA), which by default maintains a cache of directory information for LNKLST data sets, was stopped in order to remove its ENQ against LNKLST data set MY.LNKLST.DATASET.
- Once the data set ENQs were removed, the user was able to rename data sets, effectively swapping out the old for the new.
- Once this activity was complete, the LNKLST,ALLOCATE command reinstated the LNKLST ENQ on data set MY.LNKLST.DATASET, and LLA was restarted to reinstate its ENQ.
- First note that, when a LNKLST set is activated, the "LNKLST view" is captured in that LNKLST's DEB. For each data set in the LNKLST set, the DEB indicates the volume on which that data set lives, and its location on that volume.
- None of the listed actions results in a change to the LNKLST DEB. In particular, the renaming of the data set causes no update to the LNKLST DEB. Therefore, after all of these actions take place, the LNKLST DEB still indicates the volume and position on the volume of the old MY.LNKLST.DATASET.
- In contrast, the START LLA command causes LLA to rebuild its cache of directory entries for the data sets in the LNKLST set. When LLA initialization processes data set MY.LNKLST.DATASET, LLA uses the current directory entry for that data set. This entry points to the new MY.LNKLST.DATASET.
- As a result of the command sequence, LNKLST processing and LLA processing become out of step. LNKLST processing is using the old MY.LNKLST.DATASET, while LLA is using the new MY.LNKLST.DATASET.
The way to correctly make a LNKLST data set swap is to use dynamic LNKLST commands. Doing so notifies LNKLST processing that changes are being made and that LNKLST control blocks need to be updated. The following three-step sequence of commands accomplishes this, although it requires use of the LNKLST UPDATE,JOB= parameter. All previously documented risks still apply.
STOP LLA
SETPROG LNKLST,DELETE,NAME=LNKLST2,DSNAME=MY.LNKLST.DATASET
SETPROG LNKLST,ACTIVATE,NAME=LNKLST2
SETPROG LNKLST,UPDATE,JOB=*
- If the data set is no longer in any active LNKLST, which would be the case after doing a SETPROG LNKLST,UPDATE,JOB=* command as described in Step 1, then dynamic LNKLST processing will no longer hold the XCFAS ENQ on this data set.
- If the data set is still in at least one active LNKLST, which could be the case if you did not specify SETPROG LNKLST,UPDATE,JOB=*, you will find that the XCFAS ENQ is still held for this data set. You should identify which active LNKLST is still using the data set, and then use additional dynamic LNKLST commands similar to those described in Step 1 to address this. Never use the SETPROG LNKLST,UNALLOCATE command to bypass dynamic LNKLST protection of a data set in an active LNKLST.
If the data set in question is still being managed by LLA, as part of either an active or inactive LNKLST, LLA will have an ENQ on the data set. Issuing MODIFY LLA,REFRESH is not sufficient to remove LLA's ENQ on the removed data set. Instead, you must issue STOP LLA to remove the LLA ENQ on the data set. In our example, STOP LLA was issued at the beginning of Step 1 prior to the dynamic LNKLST changes, but alternatively you can STOP LLA during Step 2.
Reinstating the LLA ENQ
SETPROG LNKLST,ADD,NAME=LNKLST3,DSNAME=MY.LNKLST.DATASET
SETPROG LNKLST,ACTIVATE,NAME=LNKLST3
SETPROG LNKLST,UPDATE,JOB=*
START LLA,SUB=MSTR
Document Location
Worldwide
Was this topic helpful?
Document Information
Modified date:
08 May 2024
UID
ibm10879235