Master Mainframe Technologies - COBOL, JCL, DB2, VSAM, CICS & More
ABEND Codes SQLCODEs File Status Interview Prep Contact
🖥 JCL

JCL DD Statement Basics

Beginner 🕑 15 min read 👁 0 views

15

Code Example


## JCL DD Statement Basics

The DD (Data Definition) statement describes datasets used by a program and connects them to program file references.

### Syntax
\`\`\`jcl
//ddname DD parameters
\`\`\`

### DD Name
- 1-8 characters
- Must match program's file name (SELECT in COBOL)
- Special names: STEPLIB, JOBLIB, SYSOUT, etc.

### Key Parameters

| Parameter | Description |
|-----------|-------------|
| DSN/DSNAME | Dataset name |
| DISP | Dataset disposition |
| UNIT | Device type |
| SPACE | Space allocation |
| DCB | Data control block |
| SYSOUT | Output class |

### DSN Parameter
\`\`\`jcl
DSN=fully.qualified.dataset.name
DSN=&&TEMPFILE          (temporary)
DSN=*.STEP1.DDNAME      (backward reference)
\`\`\`

### Common DD Types
1. **Disk datasets** - Permanent files
2. **Tape datasets** - Sequential files
3. **SYSOUT** - Printed output
4. **DUMMY** - Null file
5. **Instream data** - Data in JCL

### DDname Standards
- SYSPRINT: Program output listing
- SYSIN: Program input
- SYSUT1-n: Utility work files
- STEPLIB: Program library