Libraries, comparisons and volumes: IEBCOPY, IEBCOMPR, IEHLIST and ADRDSSU
IEBCOPY manages partitioned datasets, IEBCOMPR and SuperC tell you whether two files match, IEHLIST reads what is on a volume, and ADRDSSU moves and backs up data at the storage level. Each solves a different shape of problem.
IEBCOPY: the library utility
IEBCOPY copies members between PDS and PDSE libraries, unloads a library to a sequential file and reloads it, and compresses a PDS in place. It is how source, JCL and load libraries are copied between environments when no change-management tool does it for you.
//COPYMEM EXEC PGM=IEBCOPY //SYSPRINT DD SYSOUT=* //FROMLIB DD DSN=TEST.PAY.JCLLIB,DISP=SHR //TOLIB DD DSN=QA.PAY.JCLLIB,DISP=SHR //SYSIN DD * COPY OUTDD=TOLIB,INDD=FROMLIB SELECT MEMBER=((PAYRUN01,,R),(PAYRUN02,,R)) /*
COPY OUTDD=x,INDD=ySELECT MEMBER=(A,B)(name,newname,R)EXCLUDE MEMBER=(A)Without R (or INDD=((y,R)) to replace all members), a member that already exists in the output is not replaced; IEBCOPY lists it in SYSPRINT and can still end with only a warning return code. That is a frequent reason a 'successful' promotion did not change anything.
Compressing a PDS
A PDS does not reuse space from deleted or replaced members. Over time it fills up and a save fails with an E37 space abend even though the library holds little live data. Copying the library onto itself (COPY OUTDD=LIB,INDD=LIB with one DD) compresses it. PDSEs reclaim space automatically and do not need compressing.
IEBCOMPR and SuperC: do these match?
IEBCOMPR compares two sequential datasets record by record, or two PDS libraries member by member. It ends RC 0 when the inputs are equal and RC 8 when they differ, reporting mismatched records in SYSPRINT. Its report is terse and byte-oriented, so in practice most people use SuperC, the ISPF compare utility (usually option 3.12, or batch program ISRSUPC), which produces a readable line-by-line difference listing.
IEHLIST: what is on a volume
IEHLIST reads directly from a disk volume rather than through the catalog. LISTVTOC lists the datasets in the volume table of contents, and LISTPDS lists a PDS directory. It needs a DD that allocates the volume itself.
//LISTV EXEC PGM=IEHLIST //SYSPRINT DD SYSOUT=* //VOL1 DD UNIT=3390,VOL=SER=WORK01,DISP=OLD //SYSIN DD * LISTVTOC FORMAT,VOL=3390=WORK01 /*
Most people now use ISPF 3.4 with a volume filter, or IDCAMS LISTCAT, for the same answers. IEHLIST is still useful when a dataset is on a volume but not in the catalog, the classic 'it exists but nobody can find it' problem.
ADRDSSU: storage-level copy and backup
ADRDSSU is the program behind DFSMSdss. It works below the level of records: it dumps datasets or whole volumes to tape or disk, restores them, copies datasets between volumes, and releases unused space. A logical dump selects datasets by name filters; a physical dump copies tracks from a volume.
| Command | Typical use |
|---|---|
| DUMP | Back up a set of datasets before a risky change, or a whole volume |
| RESTORE | Bring datasets back from a dump |
| COPY | Move datasets to new volumes, for example during storage migrations |
| RELEASE | Free over-allocated space at the end of datasets |
ADRDSSU is normally run by storage administrators, and powerful options are protected by security profiles. Routine daily backup and migration is usually done by DFSMShsm, which calls DFSMSdss underneath; some sites use vendor products such as FDR from Innovation Data Processing instead. As a developer you are more likely to ask for a restore than to run one.
Common mistakes
IEBCOPY will not overwrite an existing member unless you ask. Code R on SELECT or INDD, and read SYSPRINT rather than trusting the return code alone.
Concurrent updates during a compress can corrupt the directory. Get exclusive use, back up first, or move busy libraries to PDSE.
IEBCOMPR only says equal or not, with a terse report. Use SuperC when a person needs to see what changed.
What you will see at work
- Release jobs use IEBCOPY to move JCL, PROCs and load modules between environments where no SCM tool handles it.
- Testers use SuperC to compare a program's output before and after a change; differences are reviewed line by line.
- Before a risky data fix, support asks the storage team for an ADRDSSU dump, or runs one if site standards allow.
Key terms
Check your understanding.
Take this lesson's quiz and save your progress. Free.