Skip to main content

Introduction

In JCL, the DD (Data Definition) statement is used to describe the datasets a program will use—whether for input, output, or temporary processing. While the basic structure is straightforward, some of the DD statement’s features behave in ways that are not obvious to beginners. Parameters like DUMMY, SYSOUT, dataset concatenation, and space allocation rules often lead to confusion.

This handout focuses only on those tricky or commonly misunderstood aspects of the DD statement that deserve extra clarification. These concepts are simplified for learning purposes, but IBM’s official documentation links are provided for deeper exploration or validation.

SYSOUT vs DSN vs DUMMY

These all define destinations for output but behave differently:

TypeUsage ExampleMeaning
DSN=DSN=MY.OUTPUT.FILEOutput to a dataset
SYSOUT=*SYSOUT=*Sends output to JES spool (e.g., JESMSGLG)
DUMMYDD DUMMYNo Allocation done. Ignore the input or Discards the output
  • Use SYSOUT=* to capture program output (e.g., report) in SPOOL.
  • Use DSN= when you want to store output as a dataset.
  • Use DUMMY when output is not needed.

Common Mistake: Using SYSOUT=* assuming it creates a dataset—it's spooled, not cataloged.

DUMMY Parameter

IBM Docs - Dummy Parameter

Used like:

//PRINTDD DD DUMMY
  • Suppresses actual I/O.
  • For input: no data is read.
  • For output: data is discarded (sent nowhere).

Common Mistake: Assuming DUMMY behaves identically across all programs. Some programs still expect data and may abend.

DCB vs Dataset Catalog Attributes

DCB includes RECFM, LRECL, BLKSIZE, etc. Example:

//DD1 DD DSN=MY.FILE,DISP=SHR,DCB=(RECFM=FB,LRECL=80)
  • If dataset exists and is cataloged: system uses stored DCB unless you override.
  • If dataset is new: DCB must be provided if not defaulted from the program or SMS.

Common Mistake: Not providing DCB when creating a new dataset—leads to allocation failure.

BLKSIZE and BLKSIZE=0 Behavior

BLKSIZE=0 tells the system to choose the optimal block size based on device and LRECL.

//OUTDD DD DSN=MY.FILE,DISP=(NEW,CATLG),DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
  • Works well for most cases.
  • Can improve performance.
  • Can be overridden by SMS or dataset model.

Common Mistake: Manually specifying BLKSIZE that's not a multiple of LRECL when RECFM=FB, causing errors.

Concatenated Datasets

IBM Docs - Concatenated Datasets

Used when you want multiple datasets read as one:

//INFILE DD DSN=DATA1,DISP=SHR
// DD DSN=DATA2,DISP=SHR
  • All DDs use the same DDNAME.
  • Datasets are read in order.
  • Useful for input only. Not allowed for output.
  • Attributes (like RECFM) must match.

Common Mistake: Trying to concatenate output datasets or mixing incompatible RECFMs/LRECLs.

Follow the rules as mentioned below:

  • RECFM (Record Format) Compatibility
    • Prefer using the same RECFM across datasets (e.g., FB, VB, FBA, VBA).
    • F, FB, and FBA can be mixed (same base format).
    • Mixing F with V or VB causes RC=12: "INCONSISTENT RECORD FORMATS".
  • LRECL Compatibility
    • Fixed (F) Datasets
      • Must have the same LRECL, or you get: "IEB351I I/O ERROR".
    • FB or FBA Datasets
      • Must have the same LRECL.
      • If a smaller LRECL is first → Records split across multiple lines.
      • If a larger LRECL is first → Extra characters appear as junk.
    • Mixing F with FB/FBA
      • F follows FB/FBA LRECL rules.
    • Variable (V, VB, VBA) Datasets
      • First dataset must have the largest LRECL.
      • Smaller LRECL first causes RC=12: "IEB308I PERMANENT INPUT ERROR".
  • BLKSIZE Considerations
    • FB Datasets: BLKSIZE must be a multiple of LRECL (no truncation or errors).
    • VB Datasets: BLKSIZE must be greater than LRECL + 4.

Temporary Datasets (DSN=&&TEMP)

IBM Docs - Temporary Dataset

Temporary datasets start with && and exist only during the job. You can create them using:

//MYTEMP DD DSN=&&TEMP,UNIT=SYSDA,SPACE=(TRK,1),DISP=(NEW,PASS)
  • &&TEMP: Indicates a temporary dataset.
  • DISP=(NEW,PASS): Keeps it available for the next step.
  • If you use DISP=(NEW,DELETE), it's deleted at step end.
  • Without DISP, default is (NEW,DELETE)—it vanishes after the step.

Common Mistake: Expect the dataset to persist across steps without using PASS.

JCLLIB vs JOBLIB vs STEPLIB – Key Differences and Common Confusion

JCLLIB, JOBLIB, and STEPLIB serve different purposes in a job, but students often confuse them due to similar-sounding names.

IBM Docs - Special DD Statement IBM Docs - JCLLIB

JCLLIB Statement – For Cataloged Procedures and INCLUDE

  • Used only to tell the system *where to look for cataloged procedures- or INCLUDE groups.

  • Has *no effect- on program execution (PGM=...).

  • Only *one JCLLIB- allowed per job.

  • Syntax example:

    //MYLIB JCLLIB ORDER=(MY.PROCLIB1,MY.PROCLIB2)
  • Common confusion:

    • ❌ It *does not- help in loading programs or load modules.
    • ✅ It is only for procedures (PROCs) and INCLUDE statements.

JOBLIB – Load Module Library for the Entire Job

  • DD statement placed right after JOB statement.

  • Applies to all steps, unless overridden.

  • Used to tell the system *where to find programs- used in PGM=....

  • Example:

    //MYJOB JOB ...
    //JOBLIB DD DSN=MY.LOAD.LIB,DISP=SHR

STEPLIB – Load Module Library for a Single Step

  • DD statement placed *right after the EXEC statement- of a step.

  • Applies only to that step.

  • Overrides JOBLIB only for that step.

  • Example:

    //STEP01 EXEC PGM=MYPGM
    //STEPLIB DD DSN=STEP.LOAD.LIB,DISP=SHR

Behavior When Both JOBLIB and STEPLIB Are Used

  • STEPLIB takes priority *only for the step- where it's coded.
  • If program not found in STEPLIB or JOBLIB, system searches system libraries (e.g., SYS1.LINKLIB).
  • If program still not found → S806 abend.

Common Mistakes

MistakeClarification
Using JCLLIB to load programs❌ JCLLIB is only for PROCs and INCLUDEs
Thinking STEPLIB applies to all steps❌ It applies only to the current step
Assuming JOBLIB is searched before STEPLIB❌ STEPLIB overrides JOBLIB for that step
Using multiple JCLLIB statements❌ Only one allowed per job

Reserved DD Names in JCL – What They Actually Do

Some DD names have special meaning and behavior in JCL, especially when used with utilities or system programs. These are not syntactically reserved, but are functionally reserved.

IBM Docs - Special DD Statement

Reserved or Expected DD Names

DD NamePurpose
JOBLIBLoad library for all steps in the job (must be after JOB).
STEPLIBLoad library for one step (must be after EXEC).
SYSINUsually used to provide in-stream data or control statements.
SYSPRINTOutput for informational messages from utilities.
SYSOUTSends output to JES spool. Often used with SYSOUT=*.
SYSABENDUsed to generate a system dump on abend (short dump).
SYSUDUMPGenerates a detailed user dump on abend.
SYSMDUMPMachine-readable dump, used with IPCS.
CEEDUMPDump from Language Environment (LE).
SYSTSPRTOutput for TSO commands run in batch (e.g., IKJEFT01).

Commonly Misunderstood Behavior

  • SYSIN must be used carefully with DD * or DD DATA – students often forget delimiters.
  • Dumps like SYSABEND, SYSUDUMP, SYSMDUMP, and CEEDUMP can coexist; system behavior depends on LE or system settings.
  • SYSTSPRT is often forgotten when using TSO commands in batch – output may be missing without it.
  • Some utilities expect SYSPRINT or SYSOUT – missing them may silently suppress output.