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

JCL SPACE Parameter

Beginner 🕑 12 min read 👁 0 views

12

Code Example


## JCL SPACE Parameter

The SPACE parameter allocates disk space for new datasets.

### Syntax
\`\`\`jcl
SPACE=(unit,(primary,secondary,directory),RLSE,CONTIG,ROUND)
\`\`\`

### Allocation Units

| Unit | Description |
|------|-------------|
| TRK | Tracks |
| CYL | Cylinders |
| blklen | Block length in bytes |
| reclen | Record length (AVGREC) |

### Components
- **Primary**: Initial allocation
- **Secondary**: Additional allocation (up to 15 extents)
- **Directory**: PDS directory blocks

### Optional Keywords

| Keyword | Description |
|---------|-------------|
| RLSE | Release unused space |
| CONTIG | Contiguous allocation |
| MXIG | Maximum contiguous |
| ALX | Up to 5 contiguous extents |
| ROUND | Round to cylinder boundary |

### AVGREC Parameter
For record-based allocation:
\`\`\`jcl
SPACE=(80,(1000,500),RLSE),AVGREC=U    Units (records)
SPACE=(80,(1000,500),RLSE),AVGREC=K    Thousands
SPACE=(80,(1000,500),RLSE),AVGREC=M    Millions
\`\`\`

### Size Guidelines
- TRK: Small files (< 15 tracks)
- CYL: Large files
- RLSE: Always use to return unused space