The LABEL parameter in JCL provides information about dataset labels, primarily for tape datasets but also applicable to DASD datasets. It specifies attributes like the file sequence number, label type, and retention period.
Using the LABEL parameter is crucial for processing multi-file tape volumes, ensuring correct label processing, and managing data retention.
12//ddname DD DSNAME=dataset.name,DISP=..., // LABEL=(data-set-seq-no,label-type,retention-option,input-output)
The LABEL parameter has several positional subparameters. Not all are required; defaults are often assumed if omitted.
Position | Subparameter | Description | Common Values | Default |
---|---|---|---|---|
1 | data-set-seq-no | Dataset sequence number (1-9999) for tape files. | 1, 2, 3, ... | 1 |
2 | label-type | Specifies the type of label processing. | SL, SUL, AL, AUL, NL, NSL, BLP, LTM, BP | SL (for output), assumes input label type |
3 | retention-option | Specifies retention period (RETPD=dddd) or expiration date (EXPDT=yyddd or yyyy/ddd). | RETPD=10, EXPDT=99365, EXPDT=2025/001 | Installation default |
4 | input-output | Indicates whether the dataset is for input (IN) or output (OUT). Primarily used with password protection (PASSWORD/NOPWREAD). | IN, OUT | OUT (for new datasets), IN (for existing) |
123//TAPEIN DD DSN=MY.TAPE.FILE,DISP=OLD, // UNIT=TAPE, // LABEL=(2,SL)
Specifies reading the 2nd file (dataset sequence number 2) with standard labels (SL).
123//TAPEOUT DD DSN=NEW.TAPE.DATA,DISP=(NEW,KEEP), // UNIT=TAPE, // LABEL=(,SL,RETPD=30)
Writes the first file (default sequence 1) with standard labels (SL) and sets a retention period of 30 days. Note the leading comma to skip the first positional parameter.
123//ARCHIVE DD DSN=ARCHIVE.DATA.Y2024,DISP=(NEW,KEEP), // UNIT=TAPE,VOL=SER=ARC001, // LABEL=(1,SL,EXPDT=2026/365)
Writes the first file with standard labels and sets the expiration date to the last day of 2026.
123//NLTAPE DD DSN=UNLABELED.DATA,DISP=(NEW,KEEP), // UNIT=TAPE, // LABEL=(,NL)
Specifies that the tape has no labels (NL). DCB information is usually required when using NL.
123//BLPEX DD DSN=FOREIGN.TAPE,DISP=OLD, // UNIT=TAPE, // LABEL=(,BLP)
Instructs the system to bypass label processing entirely. This is dangerous as it can lead to overwriting important data if used incorrectly.
For SMS-managed tape datasets, the retention period specified by EXPDT or RETPD in the LABEL parameter might be overridden by the Management Class (MGMTCLAS) assigned to the dataset. The SMS policies usually take precedence.
Write JCL to create the third file on a new tape volume with standard labels, expiring on January 1st, 2027.
Write JCL to read the first file from an existing tape that uses ANSI standard labels (AL).
SL indicates standard IBM labels. SUL indicates standard IBM labels plus user labels. User labels are additional 80-byte records following the standard header/trailer labels, processed by user exit routines.
NL is used when reading or writing tapes that do not conform to any standard labeling convention, such as tapes created on non-IBM systems or for specific data interchange purposes. It requires careful handling and usually needs explicit DCB information.
If omitted for a new tape dataset, the system typically defaults to LABEL=(1,SL) with an installation-defined retention period. If omitted for an existing tape dataset, the system reads the volume label to determine the label type and assumes file sequence 1.
Yes, but its use is less common. For DASD, LABEL primarily specifies the retention period (RETPD/EXPDT) or password protection. The dataset sequence number and label type are generally not applicable.
1. Which LABEL subparameter specifies the file position on a multi-file tape volume?
2. What does LABEL=(,SL,RETPD=7) mean?
3. Which label type indicates an unlabeled tape?
4. Which LABEL subparameter sets an expiration date like January 1st, 2025?
5. What does BLP stand for and why should it be used cautiously?