z/OS Dynamic LNKLST Management
Reference : https://www.ibm.com/support/pages/node/879235
This skill provides procedures and safety guidelines for managing the z/OS Dynamic LNKLST facility using SETPROG commands. It is intended for system programmers performing actions such as adding libraries, recataloging, deleting, or renaming data sets within an active LNKLST.
Key Concepts
- •LNKLST Set: A definition of a LNKLST concatenation.
- •Current LNKLST: The set currently defined as the system default for newly starting jobs.
- •Active LNKLST: Any LNKLST set currently in use by at least one job.
- •ENQ Protection: Dynamic LNKLST maintains a SYSDSN ENQ (held by XCFAS) on all data sets in an active LNKLST to prevent modification. LLA also holds an ENQ on managed libraries.
Basic Operations
To add a new data set to the LNKLST, a new set must be defined, modified, and activated.
Command Sequence:
- •Define: Create a new set based on the current one.
text
SETPROG LNKLST,DEFINE,NAME=MYLNKLST,COPYFROM=CURRENT
- •Add: Append the new data set.
text
SETPROG LNKLST,ADD,NAME=MYLNKLST,DSN=MY.NEW.DATASET
- •Activate: Make the new set the system default for new jobs.
text
SETPROG LNKLST,ACTIVATE,NAME=MYLNKLST
Critical Risks and Warnings
1. The Danger of UNALLOCATE
Do not use SETPROG LNKLST,UNALLOCATE to modify active LNKLST data sets.
- •Purpose: It removes the SYSDSN ENQ to allow maintenance.
- •Risk: If you modify (e.g., rename/swap) a data set while jobs are still using it, the system's control blocks (DEB) will not match the physical data set.
- •Consequence: ABEND106 and ABEND0F4 in module fetch processing, potentially requiring a re-IPL.
2. The Risk of UPDATE,JOB=*
The UPDATE parameter forces running jobs to switch LNKLST sets immediately.
- •Risk: "In-flight" changes to a job's LNKLST carry inherent, unpreventable risks of fetch errors.
- •Recommendation: Use only in emergencies or strictly controlled test environments where the risk of crashing jobs is acceptable.
Safe Procedure: Swapping a LNKLST Data Set
To safely replace a data set (e.g., MY.LNKLST.DS) that is currently in the LNKLST, follow this specific order of operations to ensure LNKLST and LLA control blocks remain synchronized.
Step 1: Remove Data Set from Usage
- •Stop LLA (or use LLA specific refresh) to remove the LLA ENQ.
text
STOP LLA
- •Define a new LNKLST without the target data set.
text
SETPROG LNKLST,DEFINE,NAME=LNKLST_DEL,COPYFROM=CURRENT SETPROG LNKLST,DELETE,NAME=LNKLST_DEL,DSNAME=MY.LNKLST.DS SETPROG LNKLST,ACTIVATE,NAME=LNKLST_DEL
- •Force update (Accepting Risk) to release the XCFAS ENQ.
text
SETPROG LNKLST,UPDATE,JOB=*
- •Verify ENQs are gone:
text
D GRS,RES=(SYSDSN,MY.LNKLST.DS)
Step 2: Perform Maintenance
Perform the rename, compress, move, or delete on MY.LNKLST.DS.
Step 3: Restore Data Set to Usage
- •Define a new LNKLST adding the data set back.
text
SETPROG LNKLST,DEFINE,NAME=LNKLST_ADD,COPYFROM=CURRENT SETPROG LNKLST,ADD,NAME=LNKLST_ADD,DSNAME=MY.LNKLST.DS SETPROG LNKLST,ACTIVATE,NAME=LNKLST_ADD
- •Force update (Accepting Risk).
text
SETPROG LNKLST,UPDATE,JOB=*
- •Restart LLA to rebuild directory cache and reinstate LLA ENQ.
text
START LLA,SUB=MSTR
LLA Management Options
When managing LLA during LNKLST updates, you must force LLA to close and re-open the Data Extent Block (DEB).
- •
Option A: Stop/Start (Safest/Simplest)
- •
STOP LLAremoves all ENQs. - •
START LLA,SUB=MSTRcreates new DEBs for all managed libraries.
- •
- •
Option B: Selective Refresh (Advanced)
- •Use if stopping LLA is not feasible.
- •Requires
CSVLLAxxmembers. - •Remove:
F LLA,UPDATE=xx(Where member containsREMOVE(MY.DS)). - •Add:
F LLA,UPDATE=yy(Where member containsLIBRARIES(MY.DS)). - •Note:
F LLA,REFRESHis not sufficient to remove ENQs or rebuild DEBs for swapped data sets.