DFSMShsm exits - syncsort_cobol_migration_manager - syncsort_clone_center - syncsort_space_recovery_system - syncsort_scc_monitor - syncsort_simulate_2000 - syncsort_allocation_control_center - Latest

Syncsort™ Storage Management Easy/Exit User Guide

Product type
Software
Portfolio
Integrate
Product family
Syncsort™ software
Product
Syncsort™ Storage Management > Syncsort™ Allocation Control Center
Version
Latest
ft:locale
en-US
Product name
Syncsort Storage Management
ft:title
Syncsort™ Storage Management Easy/Exit User Guide
Copyright
2025
First publish date
1991
ft:lastEdition
2025-12-05
ft:lastPublication
2025-12-05T05:07:50.930000

The EXTHSM component of EASY/Exit automates DFSMShsm exit points using rule-based processing, replacing custom assembler code with maintainable EXIT rules. Each DFSMShsm exit is represented as an environment within EXTHSM.

Introduction

The EXTHSM component of EASY/Exit provides an easy-to-use, rule-based facility to automate the use of the exits provided by DFSMShsm. Historically, installations sometimes avoided additional DFSMShsm functionality because it required writing and maintaining assembler code. Using standard DFSMShsm exit points, EASY/Exit replaces complex assembler code with clear, easily-updated rules so installations can take full advantage of DFSMShsm.

The exits are controlled through DFSMShsm operator commands such as SETSYS EXITON and SETSYS EXI-TOFF, and optionally via DEFENV statements in the EXTHSM rules. When EXTHSM rules change for any environment, it is not necessary to reissue SETSYS commands. Instead, refresh the rules by issuing a REFRESH command to the DIF started task.

Tip: To refresh rules without restarting DFSMShsm exits, run: DIF,REFRESH EXTHSM

This topic describes the EXTHSM environments that receive control during DFSMShsm processing and provides installation instructions and examples.

Installing the HSM Exits

The following steps are required to install the HSM exits provided with EXT:

Link the HSM exit to a system linklist library

The HSM exits supplied with EXT are included in the SCC distribution load library. Load modules must be linked into an APF-authorized, reentrant, reusable (RENT, REUS), AC=1 load library accessible to DFSMShsm (typically a system linklist library).

Example JCL to copy the load modules from the SCC distribution library into a system linklist library:


 //LINKJOB JOB ...
 //LINK EXEC PGM=IEWL,PARM='RENT,REUS,AC=1'
 //SYSUT1 DD UNIT=SYSALLDA,SPACE=(CYL,(1,1))
 //SYSPRINT DD SYSOUT=*
 //PRODLIB DD DISP=SHR,DSN=DTS.R71.SLyyddd.LOADLIB
 //SYSLMOD DD DISP=SHR,DSN=apf.authorized.linklist.library
 //SYSLIN DD *
 INCLUDE PRODLIB(EXT0009)
 ALIAS ARCADEXT ALIAS ARCBDEXT ALIAS ARCCBEXT ALIAS ARCCDEXT ALIAS ARCINEXT
 ALIAS ARCMDEXT ALIAS ARCMMEXT ALIAS ARCMVEXT ALIAS ARCRPEXT ALIAS ARCSAEXT
 ALIAS ARCSDEXT ALIAS ARCTDEXT ALIAS ARCTEEXT ALIAS ARCBEEXT ALIAS ARCCREXT
 ALIAS ARCEDEXT ALIAS ARCM2EXT ALIAS ARCSKEXT NAME EXT0009(R)
 /* end of SYSLIN */
        
Note: Not all HSM exit alias names are required — include only those exits you intend to control with EXT.

Refresh LLA

After making changes to libraries in the system linklist, refresh LLA so the new copy of the load module becomes available. From a system console:

MODIFY LLA, REFRESH

Enable the exits

Enable exits using the DFSMShsm SETSYS EXITON command. Place the required SETSYS EXITON commands in the ARCCMDxx member of the DFSMShsm parameter library so the exits are loaded and enabled when DFSMShsm is started.

Example to enable an HSM exit (replace xx with the two-character exit identifier):

SETSYS EXITON(<xx>)
Note: Some DFSMShsm releases require issuing SETSYS EXITOFF(<xx>) before SETSYS EXITON(<xx>) even if no exits are currently loaded.

EXTHSM Environments

The EXTHSM product exposes many DFSMShsm exits as environments. Each environment provides variables and controls that the EXTHSM rules can use to affect DFSMShsm processing.

  • ARCADEXT — Non-SMS Dataset Deletion or Retirement (AD) Environment
  • ARCBDEXT — Volume Backup (BD) Environment
  • ARCCBEXT — Control Dataset Backup (CB) Environment
  • ARCINEXT — Initialization (IN) Environment
  • ARCMDEXT — Primary DASD Migration (MD) Environment
  • ARCMMEXT — Secondary Migration (MM) Environment
  • ARCMVEXT — Volume Space Management (MV) Environment
  • ARCRPEXT — Return Priority (RP) Environment
  • ARCSAEXT — Space Management and Backup (SA) Environment
  • ARCSDEXT — Shutdown (SD) Environment
  • ARCTDEXT — Tape Date (TD) Environment
  • ARCTEEXT — Tape-Ejected (TE) Environment

Each environment section below documents the environment description, when it is entered, relevant variables (tables), valid actions, and examples. Examples are provided as EXTHSM rule fragments.

ARCADEXT — Non‑SMS Dataset Deletion or Retirement (AD) Environment

Environment description

The ARCADEXT environment is entered during DFSMShsm migration processing when datasets that have been unreferenced for a period are candidates for deletion or retirement. EXTHSM rules may examine dataset characteristics and prevent deletion if desired. The environment applies to deletion of unreferenced datasets on primary (L0), ML1, or ML2 volumes.

Use cases include preventing deletion of non-SMS-managed datasets according to policy, issuing warning messages, or writing SMF records when deletions are prevented.

To receive control in this environment:

  • The DFSMShsm ARCADEXT exit must be active.
  • EXTHSM load modules must be in a linklist library or in a STEPLIB accessible to DFSMShsm.
  • Activate the exit with: SETSYS EXI-TON(AD).
When the environment is entered

The environment is entered for each dataset processed during DFSMShsm migration processing when DELETEBYAGE (DBA) or DELETEIFBACKEDUP (DBU) applies. It is not entered for TSO HMIGRATE commands or for migrations without DBA/DBU.

Variables for ARCADEXT

The variables described in Table 9-1 are available to EXTHSM rules in this environment. The default for &BYPASS_DELETE is NO (datasets are deleted by DFSMShsm if eligible).

Table 9-1. Variables for the ARCADEXT Environment

Name Possible Values Description
ENV ARCADEXT Deletion of unused datasets.
ENVS DBA | DBU Subenvironment: delete-by-age (DBA) or delete-if-backed-up (DBU).
DSNAME   44-character dataset or VSAM cluster name.
BYPASS_DELETE YES | NO If set to YES, the dataset is prevented from deletion.
VOLSER   Primary volume or original primary volume for the dataset.
SIZE-K-ALL   Dataset size in kilobytes (based on 2048-byte blocks).
VOL_TYPE L0 | MIG | UNKNOWN Volume type where dataset currently resides (L0 primary, MIG migration, UNKNOWN if undetermined).

Examples for ARCADEXT

Example 1 — Prevent deletion of important datasets and issue warnings

Prevent deletion of datasets with second-level qualifier PROD or datasets that currently or previously resided on primary volumes beginning with SYS33. When such a dataset is a deletion candidate, issue a warning message to the storage administrator.


DEFRULE IMPORTANTDS IF &ENV = ARCADEXT
&QUAL2 = 'PROD' OR &VOLSER = SYS33*
THEN SET &BYPASS_DELETE = YES WRITEMSG(WARNMSG)

DEFMSG WARNMSG
'WARNING! DATASET &DSNAME FOUND ELIGIBLE FOR DELETION BY HSM &ENVS PROCESSING. ORIGINAL VOLUME=&VOLSER' USERID(STGADMIN)
          
Example 2 — Prevent weekend deletions on selected volumes

Prevent DBA and DBU deletions for volumes beginning with PRODX on Saturday or Sunday.


DEFRULE NODEL
IF &ENV = ARCADEXT
&CURDAY = (SATURDAY,SUNDAY) &VOLSER = PRODX*
THEN SET &BYPASS_DELETE = YES
          
ARCBDEXT — Volume Backup (BD) Environment
Environment description

The ARCBDEXT environment is entered during DFSMShsm volume backup processing for each dataset that DFSMShsm determines should be backed up. It applies to both SMS-managed and non-SMS datasets on primary (L0) and ML1 volumes.

EXTHSM variables indicate candidate status for Backup-While-Open (BWO), dataset size, volume, and more. Use EXTHSM to bypass backups, prevent software compaction, manage serialization/enqueue behaviour, or adjust flags when bypassing backups.

To receive control:

  • Activate the ARCBDEXT exit.
  • Ensure EXTHSM load modules are in a linklist library or STEPLIB accessible to DFSMShsm.
  • Activate exit: SETSYS EXITON(BD).
When the environment is entered

Entered for each dataset processed by volume backup; volume may be primary (L0) or migration (L1). It is entered after DFSMShsm determines the dataset is eligible for backup (i.e., this environment is later than ARCSAEXT).

Variables for ARCBDEXT

Default for &BYPASS_BACKUP is NO (datasets are backed up if eligible).

Table 9-2. Variables for the ARCBDEXT Environment

Variable Name Possible Values Description
ENV ARCBDEXT DFSMShsm backup processing for a dataset.
DSNAME   44-character dataset name.
BYPASS_BACKUP YES | NO If YES, prevent the dataset from being backed up. If set to YES, set RESET_UPDFLAG (and optionally DELETE_MCL) to YES as required.
BACKUP_NOCOMP YES | NO If YES, dataset is backed up but not software compacted. Overrides some other variables to allow backup without compaction.
EXPAND_INFO YES | NO Indicates whether BWO_CANDIDATE, INUSE, and MGMTCLAS variables are valid for this level of DFSMShsm processing.
RESET_UPDFLAG YES | NO If YES (and BYPASS_BACKUP=YES), reset the format-1 DSCB update bit so dataset is not backed up in the future.
DELETE_MCL YES | NO If YES (and BYPASS_BACKUP=YES and RESET_UPDFLAG=YES), delete the MCL record describing a migrated dataset.
VOLSER   Volume where dataset currently resides (primary or original primary for migrated datasets).
SIZE-K-ALL   Size in kilobytes (2048-byte blocks base).
VOL_TYPE L0 | MIG | UNKNOWN Type of volume the dataset resides on.
BWO_CANDIDATE YES | NO Indicates if dataset is a candidate for backup-while-open processing.

Valid ARCBDEXT actions and return codes

Only certain variable combinations are valid. Table 9-3 (not reproduced here) shows allowed combinations, return codes, and DFSMShsm actions. If required, set the exit return code explicitly in rules:

SET &HSM_EXIT_RC = 8

The variable HSM_EXIT_RC overrides other variable settings affecting the exit return code in this environment.

Examples for ARCBDEXT

Example 1 — Prevent unnecessary backup of large datasets

Example: Prevent backup of datasets with second-level qualifier SYSX* on primary volumes beginning with WRK9* and larger than 500 MB. Turn off DS1IND02 so they are not included in future incremental backups.


DEFRULE NOBACKUP IF &ENV = ARCBDEXT
&QUAL2 = 'SYSX*' &VOLSER = WRK9* &VOL_TYPE = L0
&SIZE-K-ALL GT 500000
THEN SET &BYPASS_BACKUP = YES
     SET &RESET_UPDFLAG = YES
          
Example 2 — Adjust enqueue behaviour for selected datasets

Example: Require serialization for datasets beginning with PRODX.USERDATA (retry preferred), and ignore enqueue attempts for datasets beginning with PRODY.READONLY.


DEFRULE SOMEENQ IF &ENV = ARCBDEXT
IF &DSNAME = 'PRODX.USERDATA.*'
THEN SET &INUSE = RETRY_PREFERRED

IF &ENV = ARCBDEXT
IF &DSNAME = 'PRODY.READONLY.*'
THEN SET &INUSE = IGNORE
          
Example 3 — Ensure serialization for critical datasets

Example: Datasets under PRODZ.SPECIAL.DATA.* — retry required; datasets under PROD1.ANYDATA.* — no retry (NORETRY).


DEFRULE MUSTENQ IF &ENV = ARCBDEXT
IF &DSNAME = 'PRODZ.SPECIAL.DATA.*'
THEN SET &INUSE = RETRY_REQUIRED

IF &ENV = ARCBDEXT
IF &DSNAME = 'PROD1.ANYDATA.*'
THEN SET &INUSE = NORETRY
          

ARCCBEXT — Control Dataset Backup (CB) Environment

Environment description

The ARCCBEXT environment is entered after DFSMShsm control dataset (MCDS, BCDS, OCDS, and journal) backup completes, whether successful or not. Use this environment to alert administrators, write records, submit jobs (for tape copy), or take automatic actions based on backup success/failure.

To receive control: activate the ARCCBEXT exit and ensure EXTHSM load modules are accessible; use SETSYS EXITON(CB).

Variables for ARCCBEXT

Table 9-4. Variables for the ARCCBEXT Environment

Variable Possible Values Description
ENV ARCCBEXT Control dataset backup has completed.
BKUP_TYPE BACKVOL | AUTO Indicates how control dataset backup was initiated.
DATAMOVER DSS | HSM Indicates the data mover used.
MULTICLUSTER YES | NO Indicates whether MCDS/BCDS are multicluster.
JRNL_ERROR / MCDS_ERROR / BCDS_ERROR / OCDS_ERROR YES | NO Indicates whether backup succeeded for each control dataset.
JRNL_BKDSN / MCDS_BKDSN / BCDS_BKDSN / OCDS_BKDSN 44-char DSN Dataset names of the backups for each control dataset.
JRNL_BKVOLN / MCDS_BKVOLN / ... 1-20 Number of volumes used for backups.

Examples for ARCCBEXT

Example 1 — Alert administrator of CDS backup failure

Notify storage administrator when any of the control dataset backups failed.


DEFRULE CDSERR
IF &MCDS_ERROR = YES OR &BCDS_ERROR = YES OR &OCDS_ERROR = YES OR &JRNL_ERROR = YES
THEN ISSUE WRITEMSG(WARNADM)

DEFMSG WARNADM
'WARNING: HSM CDS BACKUP FAILED' USER(STGADM)
          
Example 2 — Record CDS backup statistics

Write a record to a log file allocated to the DIF started task (DDNAME CDSFILE) for use with the EXTHSM CDS Backup Monitor ISPF application.


DEFRULE CDSDB
IF &ENV = ARCCBEXT
THEN ISSUE WRITEREC(CDSREC)
DEFREC CDSREC
INIT(BLANKS) DDNAME(CDSFILE) LENGTH(900)
FIELD &CURDATE FIELD &CURTIME FIELD &BKUP_TYPE FIELD &DATAMOVER FIELD &JRNL_ERROR FIELD &MCDS_ERROR FIELD &BCDS_ERROR FIELD &OCDS_ERROR FIELD &JRNL_BKDSN FIELD &MCDS_BKDSN FIELD &BCDS_BKDSN FIELD &OCDS_BKDSN FIELD &JRNL_BKVOLN FIELD &MCDS_BKVOLN FIELD &BCDS_BKVOLN FIELD &OCDS_BKVOLN FIELD &JRNL_BKVOLS FIELD &MCDS_BKVOLS FIELD &BCDS_BKVOLS FIELD &OCDS_BKVOLS
          
Example 3 — Submit validation job if CDS backup successful

Submit a job (via REXX exec) that imports CDS backups and runs IDCAMS EXAMINE to validate structural integrity. If any backup failed, issue an operator message instead.


DEFRULE CDSCHK
IF &ENV = ARCCBEXT &DATAMOVER = HSM THEN DO
  IF &JRNL_ERROR = NO &MCDS_ERROR = NO &BCDS_ERROR = NO &OCDS_ERROR = NO
  THEN CALLREXX(EXTCBREX)
  ELSE ISSUE WRITEMSG(CBERRMSG)
END

DEFMSG CBERRMSG
'WARNING: DFSMSHSM CDS BACKUP FAILED!' WTORC(2) WTODC(2)
          

The REXX exec EXTCBREX constructs and submits JCL to an internal reader — see the sample library members referenced in the original documentation for full definitions.

Example 4 — Automatic copy of CDS backups to tape

Submit started tasks to copy CDS backup files from DASD to tape after successful backups. Use the sample catalogued procedure CDSCOPY to perform the copy via IEBGENER.


DEFRULE CDSCOPY
IF &MCDS_ERROR = NO &BCDS_ERROR = NO &OCDS_ERROR = NO &JRNL_ERROR = NO
THEN ISSUE OPERCMD(COPYJRNL,COPYMCDS,COPYBCDS,COPYOCDS)

DEFCMD COPYJRNL
'S CDSCOPY,S=&JRNL_BKDSN,T=&JRNL_BKDSN.COPY'
          

Catalogued procedure example (excerpt):


 //CDSCOPY PROC S=SOURCE,T=TARGET
 //COPY EXEC PGM=IEBGENER
 //SYSPRINT DD SYSOUT=*
 //SYSIN DD DUMMY
 //SYSUT1 DD DSN=&S,DISP=SHR
 //SYSUT2 DD DSN=&T,UNIT=(TAPE,,DEFER),
 //      DISP=(,CATLG,DELETE),
 //      LABEL=(1,SL,RETPD=30)
 // PEND
          

ARCINEXT — Initialization (IN) Environment

Environment description

The ARCINEXT environment is entered during DFSMShsm startup just after the ARCCMDxx member has been processed. Use it to write messages or statistics, run REXX execs, or start tasks whenever a DFSMShsm address space starts.

To receive control: ensure ARCINEXT exit is active and EXTHSM is started prior to DFSMShsm (or reload exit after EXTHSM start). Activate exit with SETSYS EXITON(IN).

Variables for ARCINEXT

No ARCA-specific variables are required, but variables describing DFSMShsm address space (MQCT / MCVT control blocks) are available; HSM_EXIT_RC is ignored by DFSMShsm in this environment.

Table 9-5. Values for the ARCINEXT Environment

Variable Possible Values Description
ENV ARCINEXT DFSMShsm initialization.
JOBNAME 8-character name Name of the DFSMShsm started task.
STEPNAME 8-character name Stepname for the started task.
SYSID 4-character id SMF system id on which this DFSMShsm host started.
JOBSTIME hh:mm:ss Time DFSMShsm started task was initiated.
JOBSDATE mm/dd/yy Date DFSMShsm started task was initiated.

Examples for ARCINEXT

Example 1 — Write messages for DFSMShsm startup

Write messages to DIF log and console recording job name, step name, system id, and start date/time.


DEFRULE HSMSTART IF &ENV EQ ARCINEXT
THEN ISSUE WRITEMSG(ARCSTRT01)

DEFMSG ARCSTRT01
'DFSMSHSM INITIALIZATION JOB=&JOBNAME STEP=&STEPNAME COMPLETE ON SYSTEM &SYSID AT &JOBSDATE &JOBSTIME'
GENID WTODC(2) WTORC(2) LOG(DIFLOG)
          
Example 2 — Write a DFSMShsm initialization statistics record

Write a fixed-length record to a log file at startup (suitable for report processing).


DEFRULE HSMINSTAT IF &ENV EQ ARCINEXT
THEN ISSUE WRITEREC(INSTATS)

DEFREC INSTATS DDNAME(STATSLOG) LENGTH(200)
FIELD &JOBSDATE
FIELD &JOBSTIME
FIELD &HSM_PROCNAM
FIELD &HSM_STCNAM
FIELD &HSM_HOSTID
FIELD &HSM_HOSTTYPE
FIELD &HSM_AUTHID
FIELD &ARCCMDXX
          

ARCMDEXT — Primary DASD Migration (MD) Environment

Environment description

The ARCMDEXT environment is entered when datasets migrate from primary volumes during primary space management, interval migration, or when a MIGRATE VOLUME command is issued. Applies to both SMS-managed and non-SMS datasets. EXTHSM variables describe dataset and volume characteristics.

Use cases include bypassing migration, preventing software compaction, forcing migration to DASD or tape, overriding management class defaults, or managing the Fast Subsequent Migration (reconnect) feature.

Activate exit: SETSYS EXI-TON(MD).

When the environment is entered

Entered for each dataset meeting migration criteria. Volume is always primary (L0). May overlap with ARCSAEXT processing; ARCMDEXT is entered only for datasets eligible for migration (i.e., after eligibility determination).

Variables for ARCMDEXT

Default for &BYPASS_MIGRATE is NO (datasets are migrated if eligible). If neither MIGRATE_TO_TAPE nor MIGRATE_TO_DASD is set to YES, DFSMShsm chooses the device.

Table 9-6. Variables for the ARCMDEXT Environment

Variable Name Possible Values Description
BYPASS_CLASSMIG YES | NO Convert certain class transitions into migration when conditions allow.
BYPASS_MIGRATE YES | NO If YES, prevent dataset migration.
DSNAME   44-character dataset name.
ENV ARCMDEXT Migration processing environment identifier.
ENVS PSM | INTMIG | EXTRED | (blanks) Subenvironment type: primary space management, interval migration, extent reduction, or command migration.
MD_CLASS_TRANS YES | NO Indicates candidate for class transition (read-only).
MD_CLASS2MIGOK YES | NO Indicates whether transition may be converted to migration (read-only).
MD_MIGRATE_VOL YES | NO Dataset processed due to MIGRATE VOLUME command (read-only).
MIGRATE_NOBACKUP YES | NO Allow migration even if no current backup exists.
MIGRATE_NOCOMP YES | NO Bypass software compaction for migration when set to YES.
MIGRATE_TO_DASD YES | NO Force migration to DASD.
MIGRATE_TO_TAPE YES | NO Force migration to tape.
SIZE-K-ALL   Dataset size in kilobytes.
VOL_TYPE L0 For MD this is always L0.

Examples for ARCMDEXT

Example 1 — Direct large datasets to ML2 tape

Rule: migrate datasets larger than 100 MB directly to ML2 tape (overrides SMS where applicable), except during extent-reduction processing.


DEFRULE DIRECTML2
IF &SIZE-K-ALL GT 100000 &ENVS NE (EXTRED)
THEN SET &MIGRATE_TO_TAPE = YES
          
Example 2 — Direct small datasets to ML1 DASD

Rule: migrate datasets smaller than 20 MB to ML1 DASD; exclude reconnectable datasets.


DEFRULE DIRECTML1
IF &SIZE-K-ALL LT 20000 &RECONNECTABLE = NO
THEN SET &MIGRATE_TO_DASD = YES
          
Example 3 — Prevent migration of critical datasets

DEFRULE NOMIGRATE IF &QUAL1 = SYS3*
&VOLSER = PROD*
THEN SET &BYPASS_MIGRATE = YES
          
Example 4 — Establish migration policies for non‑SMS datasets

This example demonstrates using EXTHSM rules to apply consistent migration policies for non-SMS datasets without creating many management classes.


DEFRULE NONSMSPOL
IF &SMS = NO &VOLSER = WRK* THEN SET &BYPASS_MIGRATION = YES
IF &DSNAME = PROD.* &SMS = NO
THEN SET &MIGRATE_TO_DASD = YES
     SET &MIGRATE_NOCOMP = YES
IF &SIZE-K-ALL GT 50000 &SMS = NO
THEN SET &MIGRATE_TO_TAPE = YES
          

ARCMMEXT — Secondary Migration (MM) Environment

Environment description

The ARCMMEXT environment is entered when datasets migrate from migration volumes during secondary space management or other DFSMShsm processing (e.g., L1 → L2). It is not entered for command migration of individual datasets.

Use cases include bypassing second-level migration, writing SMF/statistics, triggering jobs, or other actions.

To receive control: activate SETSYS EXI-TON(MM) and ensure EXTHSM load modules are accessible.

When the environment is entered

Entered whenever DFSMShsm determines a dataset on migration volumes must migrate again — as a result of MIGRATE VOLUME, FREEVOL, DELVOL, automatic secondary space management, or other processes.

Variables for ARCMMEXT

Default for &BYPASS_MIGRATE is NO (datasets are migrated by default).

Table 9-8. Variables for the ARCMMEXT Environment

Variable Name Possible Values Description
ENV ARCMMEXT Second-level migration.
DSNAME   44-character dataset name.
BYPASS_MIGRATE YES | NO If YES, prevent secondary migration.
SDSP YES | NO Indicates dataset resides in a Small Dataset Packing Dataset (SDSP).
L0_DAYS_UNREF nnnnn Number of days since dataset last referenced on primary DASD.
MIGRATE_TGTLVL L1 | L2 Target migration level.
MIGRATE_TGTUNIT DASD | TAPE Target device type for migration.
L0_VOLSER vvvvvv Primary DASD volume the dataset previously resided on.
MCD record variables (read-only)

EXTHSM rules in the ARCMMEXT environment may read fields from MCD records; these variables are read-only. See Table 9-9 for the complete list (MCD_VSN, MCD_NMIG, MCD_DLU, etc.).

Examples for ARCMMEXT

Example 1 — Prevent L1→L2 migration of selected datasets

Prevent migration to L2 unless at least 90 days have elapsed since last L0 reference for selected datasets (QUAL2 = 'PROD' and L0_VOLSER = SYSM*).


DEFRULE KEEPONML1 IF &QUAL2 = 'PROD'
&L0_DAYS_UNREF LT 90 &L0_VOLSER = SYSM* THEN DO
  IF &MIGRATE_TGTLVL = L1 OR &MIGRATE_TGTUNIT = DASD OR &FREEVOL_AGE_ZERO = YES
  THEN SET &BYPASS_MIGRATE = NO
  ELSE SET &BYPASS_MIGRATE = YES
END
          
Example 2 — Select SDSP datasets for FREEVOL processing

Use ARCMMEXT to select only datasets in SDSPs for migration prior to deleting SDSPs on certain DASD platforms.


DEFRULE SDSPSELECT
IF &L1_VOLSER = HSM002 &SDSP EQ NO THEN SET &BYPASS_MIGRATE = YES
          
Example 3 — Record statistics for secondary migration

DEFRULE MIGINFO
IF &DSNAME = SOME.GROUP.OF.DS* &MIGRATE_TGTLVL = L2 &MIGRATE_TGTUNIT = TAPE
THEN ISSUE WRITEREC(MIGREC)

DEFREC MIGREC DDNAME(STATSLOG) LENGTH(300)
FIELD &DSNAME FIELD &MCD_MCANM FIELD &MCD_OVSN FIELD &MCD_VSN FIELD &MCD_SIZE FIELD &MCD_DAYS FIELD &MCD_NMIG FIELD &MCD_DLC FIELD &MCD_DLR FIELD &MCD_DLU
          

ARCMVEXT — Volume Space Management (MV) Environment

Environment description

The ARCMVEXT environment is entered after DFSMShsm completes processing of a primary volume as part of MIGRATE VOLUME, interval migration, or primary space management. Use it to trigger defragmentation, start jobs, write SMF records, or take other actions after volume processing.

When the environment is entered

Entered whenever DFSMShsm completes processing for a volume that underwent space management or migration. If starting other jobs, consider time-of-day to avoid resource contention.

Variables for ARCMVEXT

Table 9-10. Variables for the ARCMVEXT Environment

Variable Name Value Description
ENV ARCMVEXT Volume migration or space management has completed.
L0_VOLSER   Primary volume serial number that was processed.
FRAG_INDEX 0-1000 Fragmentation index for the processed volume.
STORGRP   SMS storage group the volume belongs to.

Examples for ARCMVEXT

Example 1 — Issue alerts when thresholds are met

Issue a WTO if free space in the PROD storage group falls below 20%; start a defrag started task for WRK volumes with fragmentation index > 500.


DEFRULE ALERTRULE CONTINUE(NEXTIF)
IF &ENV = ARCMVEXT &STORGRP = PROD* &FREE_SPACE LT 20
THEN ISSUE WRITEMSG(ALRTMSG1)

IF &ENV = ARCMVEXT &VOLSER = WRK* &FRAG_INDEX GT 500
THEN ISSUE OPERCMD(DODEFRAG)

DEFMSG ALRTMSG1
'EXTMSG01 WARNING! LOW FREE SPACE ON VOLUME &VOLSER' WTORC(2)

DEFCMD DODEFRAG 'S EXTDFRAG,V=&L0_VOLSER' CN(0)
          

ARCRPEXT — Return Priority (RP) Environment

Environment description

The ARCRPEXT environment is entered when a request to recall a migrated dataset, recover a dataset or volume, or delete a dataset is placed on DFSMShsm work queues and must wait. Use it to prioritize requests, prevent requests, or issue confirmation messages.

Activate exit with: SETSYS EXITON(RP).

When the environment is entered

Entered for each recall, recover, or delete request that must wait (after MWE built, before MWE is queued).

Variables for ARCRPEXT

Default for &BYPASS_REQUEST is NO (requests proceed if eligible). Use PRIORITY and other variables to control request handling.

Table 9-11. Variables for the ARCRPEXT Environment

Variable Name Value Description
ENV ARCRPEXT Dataset or volume prioritization.
ENVS RECALL | RECOVER | DELETE Type of request.
DSNAME 44-char name or blanks Dataset name; blanks if the request is for a volume.
BYPASS_REQUEST YES | NO If YES, purge the MWE and cancel the request.
PRIORITY 0-100 Assign priority (0 lowest, 100 highest). Requests of same priority use FIFO order; default 50.
PRIORITY_NOWAIT YES | NO If YES, PRIORITY applies to NOWAIT requests as well; default NO.
REQUEST_SOURCE HSM | TSO | TSOBATCH | BATCH Source of request (operator, TSO user, batch, etc.).
REQUEST_TYPE WAIT | NOWAIT Indicates whether issuer will wait for request completion.
RECOVER_TYPE DATASET | VOLUME | INCRE Type of recovery request.
RP_MSGn 91–100 chars Fields RP_MSG1..RP_MSG5 for writing messages to DFSMShsm logs (special handling of ARC90xx/ARC91xx prefixes).

Examples for ARCRPEXT

Example 1 — Prioritize DFSMShsm recalls

Example rules to prioritize production recalls, give high priority to sysprog TSO recalls, lower priority for daytime tape recalls, and bypass recalls for obsolete data.


DEFRULE RCALPRTY
IF &ENV NE ARCRPEXT THEN CONTINUE AT NEXTRULE

/* PRODUCTION RECALLS HAVE ABSOLUTE PRIORITY */
IF &QUAL2 = PROD* &ENVS = RECALL
THEN SET &PRIORITY = 100

/* HIGH PRIORITY FOR SYSPROG RECALLS */
IF &ENVS = RECALL &REQUEST_SOURCE = TSO &USERID = STGADM*
THEN SET &PRIORITY = 75

/* LOW PRIORITY FOR DAYTIME TAPE RECALLS */
IF &ENVS = RECALL &DATA_SOURCE = TAPE
   &CURTIME GT 09:00:00 &CURTIME LT 17:00:00 &CURDAY NE (SATURDAY,SUNDAY)
THEN SET &PRIORITY = 40

/* WARN/PREVENT RECALLS OF OBSOLETE DATA */
IF &ENVS = RECALL &DSNAME = OLD.DATA.*
THEN SET &BYPASS_REQUEST = YES ISSUE WRITEMSG(EMSG1)

DEFMSG EMSG1
'RECALL BYPASSED FOR OLD DATASET &DSNAME. CONTACT SYSPROG' USERID(&USERID)
          
Example 2 — Prevent HDELETE of migrated production data

DEFRULE NODEL
IF &ENV EQ ARCRPEXT &ENVS = DELETE &QUAL2 = PROD*
THEN SET &BYPASS_REQUEST = YES
     SET &RP_MSG1 = 'EXT PREVENTED HDELETE OF &DSNAME'
          
Example 3 — Prioritize requests in a common recall queue

Example adjusts priority based on host id and whether the request is WAIT or NOWAIT.


DEFRULE PRTY
IF &ENV EQ ARCRPEXT &ENVS = RECALL &HSM_HOSTID = 3 THEN DO
  IF &REQUEST_TYPE = WAIT THEN SET &PRIORITY = 70
  IF &REQUEST_TYPE = NOWAIT THEN SET &PRIORITY = 90
END
          

ARCSAEXT — Space Management and Backup (SA) Environment

Environment description

The ARCSAEXT environment receives control for every dataset during DFSMShsm volume backup, migration, or space management processing. It is entered prior to the AD (ARCADEXT), BD (ARCBDEXT), and MD (ARCMDEXT) environments and allows EXTHSM to 'see all' datasets and optionally bypass later processing.

Use ARCSAEXT to examine dataset characteristics and set variables such as BYPASS_MGMTBK or BYPASS_BACKUP to prevent later processing.

Activate exit with: SETSYS EXITON(SA).

When the environment is entered

Entered for each dataset processed by DFSMShsm during volume-level space management or backup — not for individual dataset command migration/backup.

Variables for ARCSAEXT

Default for BYPASS_MGMTBK and BYPASS_BACKUP is NO (datasets are processed normally if eligible).

Table 9-12. Variables for the ARCSAEXT Environment

Variable Name Value Description
ENV ARCSAEXT Space management / backup.
ENVS DBA | DBU | MIGRATE | BACKUP Indicates the type of dataset processing.
DSNAME   44-character dataset name (cluster name for VSAM).
BYPASS_MGMTBK YES | NO If YES, dataset is not to be backed up/processed for space management; VTOC data may still be included in VTOC copy dataset.
BYPASS_BACKUP YES | NO If YES, dataset is not to be backed up.
VOLSER   Volume serial number being processed.
GDG_STATUS ACTIVE | DEFER | ROLLOFF Status of generation dataset (SMS-managed only).
DS_ERROR NODSCB | NOVVR | DUPVVR Dataset VTOC/VVDS error indicators.
VSAM_COMP INDEX | DATA Type of VSAM component.

Examples for ARCSAEXT

Example 1 — Prevent migration or deletion during holidays

Example: prevent DBA/DBU/migration processing for datasets with QUAL2 = 'TEST' between dates December 20 and January 3 (example period).


DEFRULE MIGHOLIDAY IF &ENV = ARCSAEXT
&ENVS = (DBA,DBU,MIGRATE) &QUAL2 = 'TEST' &JULIAN:CURDATE GE 2003.354
&JULIAN:CURDATE LE 2004.003
THEN SET &BYPASS_MGMTBK = YES
          
Example 2 — Identify datasets with VTOC/VVDS errors

When datasets processed for migration or deletion have VTOC/VVDS errors, write a record to an error log and prevent delete processing; allow migration and backup to continue.


DEFRULE NOTE_ERRORS IF &ENV = ARCSAEXT
IF &ENVS NE BACKUP &DS_ERROR NE '' THEN DO
  ISSUE WRITEREC(ERR_REC)
  IF &ENVS = (DBA,DBU) THEN SET &BYPASS_MGMTBK = YES
END

DEFREC ERR_REC INIT(BLANKS) DDNAME(ERRFILE) LEN(250)
FIELD &DSNAME FIELD &CURDATE FIELD &CURTIME FIELD &ENVS
          
Example 3 — Prevent backup of selected SMS datasets

DEFRULE BYPASS_BKUP IF &ENV = ARCSAEXT
IF &MGMTCLAS = MCTMP*
THEN SET &BYPASS_BACKUP = YES
          

ARCSDEXT — Shutdown (SD) Environment

Environment description

The ARCSDEXT environment receives control during DFSMShsm termination, just before functional subtasks are stopped. Use it to write messages, write SMF records, run REXX execs, start tasks, free resources, or perform other termination actions.

Note: The SD environment requires DFSMShsm version 1.3 or higher.

Activate exit with: SETSYS EXITON(SD).

When the environment is entered

The SD environment is entered once, at the termination of DFSMShsm processing (not entered if the DFSMShsm address space is cancelled).

Variables for ARCSDEXT

No variables apply explicitly to SD, but variables describing the DFSMShsm address space are available. HSM_EXIT_RC can be set but is ignored by DFSMShsm.

Table 9-13. Variables for the ARCSDEXT Environment

Variable Possible values Description
ENV ARCSDEXT DFSMShsm termination.
JOBNAME 8-character Name of the DFSMShsm started task.
STEPNAME 8-character Stepname for the DFSMShsm started task.
SYSID 4-character id SMF system id of the DFSMShsm host.
JOBSTIME / JOBSDATE / JOBSJDATE / JOBSDAY   Start time/date information for the DFSMShsm started task.

Examples for ARCSDEXT

Example 1 — Issue warnings when DFSMShsm is terminated

Send a message on termination; on weekdays send a highlighted warning to the operator. Write an SMF record and DIF log entry.


DEFRULE HSMTERM CONTINUE(NEXTIF) IF &ENV EQ ARCSDEXT
THEN DO
  ISSUE WRITEMSG(TERMMSG)
  IF &CURDAY NE (SATURDAY,SUNDAY) THEN ISSUE WRITEMSG(WARNMSG)
END

DEFMSG TERMMSG
'HSM JOB &JOBNAME &STEPNAME TERMINATED ON SYSTEM &SYSID AT &CURDATE &CURTIME'
SMF(201) LOG(DIFLOG)

DEFMSG WARNMSG
'WARNING! HSM BEING TERMINATED ON A WEEKDAY!' WTODC(2) WTORC(2)
          

ARCTDEXT — Tape Date (TD) Environment

Environment description

The ARCTDEXT environment receives control when DFSMShsm writes a backup or migration tape. It allows the expiration date for the backup to be changed from the default (1999.365) and to perform other processing when tapes are mounted.

Note: ARCTDEXT is invoked only when DFSMShsm tape security options for expiration protection are in effect. It is not used for ABARS backups (use ARCEDEXT for ABARS).

Activate exit with: SETSYS EXITON(TD).

Variables for ARCTDEXT

The primary variable for TD is EXPDT. DSNAME may indicate backup or migration. Avoid modifying JFCB variables where not recommended; HSM_EXIT_RC is ignored by DFSMShsm.

Table 9-14. Variables for the ARCTDEXT Environment

Variable Name Possible Values Description
ENV ARCTDEXT DFSMShsm tape-date processing.
DSNAME 44-character Name of backup or migration dataset being opened.
EXPDT YYYY.DDD Expiration date for the tape (default 1999.365).

Examples for ARCTDEXT

Example 1 — Change expiration date for migration tapes

DEFRULE MIGEXP
IF &ENV EQ ARCTDEXT &DSNAME = HSM.HMIGTAPE*
THEN SET &EXPDT = 2005.007
          

ARCTEEXT — Tape‑Ejected (TE) Environment

Environment description

The ARCTEEXT environment is entered during recall, recover, restore, or recycle processing when DFSMShsm detects that required tapes reside outside an automated library. It allows installations to prompt operators to insert non-library tapes into the library or to allocate non-library drives.

Activate exit with: SETSYS EXITON(TE).

When the environment is entered

Entered for dataset recalls from ML2 tapes, recovery/restore from backup or dump tapes, and recycle processing. EXTHSM variables provide tape list and location information; set &TAPE_LOC to LIBRARY when tapes are inserted.

Variables for ARCTEEXT

The default for &TAPE_LOC is NOLIB (tapes not in library).

Table 9-15. Variables for the ARCTEEXT Environment

Variable Name Values Description
ENV ARCTEEXT Non-library tapes required.
ENVS RECOVER | RECALL | RECYCLE | RESTORE Type of DFSMShsm function requested.
TAPE_LOC NOLIB | LIBRARY | ALLOCERR Location indicator for required tapes; set to LIBRARY when tapes are moved into the library.
COMMAND_TYPE DATASET | VOLUME Indicates dataset-level or volume-level operation.
TAPEVOLN 1-256 Number of tape volumes required.
TAPEVOLS vvvvvv,vvvvvv... Comma-separated list of required volume serial numbers.
Return codes for ARCTEEXT

Table 9-16. ARCTEEXT Return Codes, Variable Settings, and DFSMShsm Actions

RC Variable Settings DFSMShsm Action
0 TAPE_LOC = NOLIB Required tapes are not in a library.
4 TAPE_LOC = LIBRARY Required tapes are in a library.
8 TAPE_LOC = ALLOCERR Fail the request for tapes with an allocation error.

Examples for ARCTEEXT

Example 1 — Prompt operator to load tapes into library

Example: present a message asking operator to load required tapes. Responses: 'L' = tapes in library, 'N' = leave tapes outside library (allocate non-library drives), 'X' = fail request.


DEFRULE LIBPROMPT IF &ENV = ARCTEEXT
&ENVS = (RESTORE,RECALL) &TAPETYPE = ML2 &COMMAND_TYPE = DATASET
THEN DO
  IF &LIBREPLY = 'L' THEN SET &TAPE_LOC = LIBRARY
  IF &LIBREPLY = 'N' THEN SET &TAPE_LOC = NOLIB
  IF &LIBREPLY = 'X' THEN SET &TAPE_LOC = ALLOCERR
END

DEFVAR LIBREPLY 'USRFLDC1(1,1)' OPER(WRITEMSG(M1,M2,M3,M4,M5)) WILD

DEFMSG M1 'DIF0001I &TAPEVOLN NONLIBRARY VOLUMES REQUIRED' WTORC(2)
DEFMSG M2 'DIF0001I FOR DFSMSHSM FOR RESTORE/RECALL' WTORC(2)
DEFMSG M3 'DIF0001I &TAPEVOLS ' WTORC(2)
DEFMSG M4 'DIF0001I INSERT IN LIBRARY AND REPLY ''L''' WTORC(2)
DEFMSG M5 'DIF0001I OR ''N'' IF VOLUMES CANNOT BE INSERTED' WTORC(2)
          

Additional guidance and resources

Many sample rules, REXX execs, catalogued procedures, and ISPF panels referenced in the examples are provided in the SCC sample libraries (members referenced throughout the examples). Consult the sample libraries for complete JCL, REXX, and rule sets.

Important: Ensure EXTHSM load modules are APF-authorized and accessible in a linklist or STEPLIB library visible to DFSMShsm. Confirm required DFSMShsm SETSYS commands are present in startup members as appropriate.