AgentSkillsCN

zos-dynamic-lnklst-management

为系统程序员提供关于安全使用z/OS动态LNKLST设施的专家指导,包括数据集交换、LLA交互,以及风险缓解措施。

SKILL.md
--- frontmatter
name: zos-dynamic-lnklst-management
description: Expert guidance on safely using the z/OS Dynamic LNKLST facility, including dataset swapping, LLA interaction, and risk mitigation for system programmers.

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:

  1. Define: Create a new set based on the current one.
    text
    SETPROG LNKLST,DEFINE,NAME=MYLNKLST,COPYFROM=CURRENT
    
  2. Add: Append the new data set.
    text
    SETPROG LNKLST,ADD,NAME=MYLNKLST,DSN=MY.NEW.DATASET
    
  3. 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

  1. Stop LLA (or use LLA specific refresh) to remove the LLA ENQ.
    text
    STOP LLA
    
  2. 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
    
  3. Force update (Accepting Risk) to release the XCFAS ENQ.
    text
    SETPROG LNKLST,UPDATE,JOB=*
    
  4. 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

  1. 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
    
  2. Force update (Accepting Risk).
    text
    SETPROG LNKLST,UPDATE,JOB=*
    
  3. 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 LLA removes all ENQs.
    • START LLA,SUB=MSTR creates new DEBs for all managed libraries.
  • Option B: Selective Refresh (Advanced)

    • Use if stopping LLA is not feasible.
    • Requires CSVLLAxx members.
    • Remove: F LLA,UPDATE=xx (Where member contains REMOVE(MY.DS)).
    • Add: F LLA,UPDATE=yy (Where member contains LIBRARIES(MY.DS)).
    • Note: F LLA,REFRESH is not sufficient to remove ENQs or rebuild DEBs for swapped data sets.