MainframeMaster

JCL Tutorial

LABEL: JCL Label Parameter

Progress0 of 0 lessons

What is LABEL?

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.

Syntax and Subparameters

Basic Syntax

jcl
1
2
//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.

Positional Subparameters

PositionSubparameterDescriptionCommon ValuesDefault
1data-set-seq-noDataset sequence number (1-9999) for tape files.1, 2, 3, ...1
2label-typeSpecifies the type of label processing.SL, SUL, AL, AUL, NL, NSL, BLP, LTM, BPSL (for output), assumes input label type
3retention-optionSpecifies retention period (RETPD=dddd) or expiration date (EXPDT=yyddd or yyyy/ddd).RETPD=10, EXPDT=99365, EXPDT=2025/001Installation default
4input-outputIndicates whether the dataset is for input (IN) or output (OUT). Primarily used with password protection (PASSWORD/NOPWREAD).IN, OUTOUT (for new datasets), IN (for existing)

Common Label Types

  • SL: IBM Standard Label (most common)
  • SUL: IBM Standard and User Labels
  • AL: ANSI Standard Label
  • AUL: ANSI Standard and User Labels
  • NL: No Labels (unlabeled tapes)
  • NSL: Non-Standard Labels (processed by user routines)
  • BLP: Bypass Label Processing (treats tape as unlabeled, danger!)
  • LTM: Leading Tape Mark (used with NL/NSL)
  • BP: Bypass processing (used for reading ISO/ANSI Version 1 unlabeled tapes)

LABEL Parameter Examples

Example 1: Reading the Second File on a Standard Labeled Tape

jcl
1
2
3
//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).

Example 2: Writing a New File with 30-Day Retention

jcl
1
2
3
//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.

Example 3: Writing a File with Expiration Date

jcl
1
2
3
//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.

Example 4: Processing an Unlabeled Tape

jcl
1
2
3
//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.

Example 5: Bypass Label Processing (Use with Caution!)

jcl
1
2
3
//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.

LABEL and SMS

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.

Best Practices for LABEL

Recommendations

  • Always specify the correct dataset sequence number when reading multi-file tapes.
  • Use standard labels (SL) whenever possible for compatibility and data integrity.
  • Avoid BLP unless you are absolutely certain of the tape content and structure.
  • Use EXPDT or RETPD to manage data retention explicitly, especially for non-SMS tapes.
  • Be aware of installation standards regarding label types and retention periods.
  • For unlabeled tapes (NL), ensure DCB information is provided.
  • Understand how SMS Management Classes might interact with LABEL retention specifications.

LABEL Exercises

Exercise 1: Write Third File with Expiration

Write JCL to create the third file on a new tape volume with standard labels, expiring on January 1st, 2027.

Exercise 2: Read ANSI Labeled Tape

Write JCL to read the first file from an existing tape that uses ANSI standard labels (AL).

Frequently Asked Questions

What is the difference between SL and SUL?

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.

When would I use NL (No Labels)?

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.

What happens if I omit the LABEL parameter?

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.

Can I use LABEL for DASD datasets?

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.

Test Your Knowledge

1. Which LABEL subparameter specifies the file position on a multi-file tape volume?

  • label-type
  • retention-option
  • data-set-seq-no
  • input-output

2. What does LABEL=(,SL,RETPD=7) mean?

  • Read the 7th file with standard labels
  • Write the first file with standard labels, retain for 7 days
  • Write the 7th file with standard labels
  • Read the first file, bypassing 7 labels

3. Which label type indicates an unlabeled tape?

  • SL
  • AL
  • BLP
  • NL

4. Which LABEL subparameter sets an expiration date like January 1st, 2025?

  • RETPD=2025
  • EXPDT=25001
  • RETPD=yyddd
  • EXPDT=2025/001

5. What does BLP stand for and why should it be used cautiously?

  • Basic Label Processing; it is the default
  • Bypass Label Processing; it can overwrite data if used incorrectly
  • Block Label Parameter; it defines block size
  • Backup Label Provided; it indicates a backup tape