MainframeMaster

JCL Tutorial

JCL Coding Sheet

Progress0 of 0 lessons

Historical Perspective on JCL Coding Sheets

Before the era of digital editors and IDEs, mainframe programmers used physical coding sheets to write their JCL. These paper forms were designed with columns that aligned with punched card requirements, which were the primary input medium for early mainframe systems.

The Evolution of JCL Entry Methods

1. Punched Cards Era (1960s-1970s)

  • Programmers wrote JCL on coding sheets
  • Data entry operators punched the code onto 80-column cards
  • Card decks were submitted to the computer operator
  • Errors required creating new punched cards

2. Terminal Entry Era (1970s-1980s)

  • Direct entry via terminals (TSO/ISPF)
  • Line editors like EDIT
  • Visual representation of the 80-column format
  • Still required understanding of column positioning

3. Modern Era (1990s-Present)

  • GUI-based editors and IDEs
  • Syntax highlighting and validation
  • Less focus on physical columns
  • JCL structure remains based on the original column format

Despite the shift to digital environments, understanding the traditional JCL coding sheet layout remains important, as it explains many of JCL's formatting rules and constraints.

Column Significance in JCL

JCL's strict formatting rules derive from the 80-column punched card format. Each column has a specific purpose:

ColumnsPurposeRequirements
1-2Identifier FieldMust contain // for JCL statements or //* for comments
3-10Name FieldContains jobname, stepname, or ddname (or blank for continuation)
11Blank FieldMust be a blank space (separates name from operation)
12-71Operation/Operand FieldContains operation (JOB, EXEC, DD) and parameters
72Continuation ColumnAny non-blank character indicates continuation to next line
73-80Sequence NumbersOriginally used for card deck sequencing, mostly ignored now

Visual Representation of a JCL Coding Sheet


|....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
//JOBNAME JOB (ACCT),'NAME',CLASS=A,MSGCLASS=X                           00000100
//STEP1   EXEC PGM=PROGRAM                                                00000200
//DD1     DD   DSN=MY.DATASET,DISP=SHR                                    00000300
                    

The ruler above the JCL statements shows column positions. Note how each field aligns to specific columns.

Continuation Characters

When JCL statements are too long to fit in a single line (columns 1-71), they need to be continued on the next line. This is indicated by a continuation character in column 72.

Continuation Rules

  • Any non-blank character in column 72 indicates continuation
  • Traditionally, an 'X' is used, but any character works
  • The continuation line must start with // in columns 1-2
  • Columns 3-15 of the continuation line must contain at least one blank
  • Continuation begins at the first non-blank character in the continuation line
  • You can only break a statement after a complete parameter or comma
  • Comments cannot be continued

Continuation Example

jcl
1
2
3
//STEP1 EXEC PGM=MYPROG,REGION=4M, X // PARM='OPTION1,OPTION2, X // OPTION3,OPTION4'

Notice the 'X' in column 72 (not visible in all editors) and how the continuation lines have blank name fields.

Statement Identification

JCL statements are identified by their format and content in specific columns:

JCL Statement Types

  • JOB Statement: Starts with // in columns 1-2, has a name in columns 3-10, and JOB in the operation field
  • EXEC Statement: Starts with // in columns 1-2, has a name in columns 3-10, and EXEC in the operation field
  • DD Statement: Starts with // in columns 1-2, has a name in columns 3-10, and DD in the operation field
  • Comment Statement: Starts with //* in columns 1-3
  • Delimiter Statement: Typically /* in columns 1-2, used to mark the end of in-stream data
  • Null Statement: Just // in columns 1-2, marks the end of a job

Statement Sequence Example

jcl
1
2
3
4
5
6
7
8
//* THIS IS A COMMENT STATEMENT //MYJOB JOB (ACCT),'JOHN DOE',CLASS=A JOB STATEMENT //* ANOTHER COMMENT //STEP1 EXEC PGM=IEFBR14 EXEC STATEMENT //DD1 DD DISP=(NEW,CATLG), DD STATEMENT // DSN=MY.DATASET, // SPACE=(TRK,(1,1)) // NULL STATEMENT

Each statement type has distinct identification characteristics based on its position and content.

Best Practices for Formatting

Although modern JCL editors don't strictly enforce column positioning, following these formatting best practices improves readability and maintainability:

Alignment

  • Align operation fields (JOB, EXEC, DD) consistently
  • Indent continuation lines for better readability
  • Start parameters at the same column position
  • Align comments for visual consistency

Statement Grouping

  • Use blank comment lines to separate logical groups
  • Keep related statements together
  • Use comment blocks to identify major sections
  • Maintain consistent spacing between steps

Parameter Formatting

  • One parameter per line for complex statements
  • Group related parameters on the same line
  • Use consistent parameter ordering
  • Align related parameters in different statements

Naming Conventions

  • Use descriptive jobnames and stepnames
  • Follow company naming standards
  • Use sequential numbers for related steps (STEP01, STEP02)
  • Use meaningful DD names that indicate purpose

Well-Formatted JCL Example

jcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//********************************************* //* * //* MONTHLY SALES REPORT JOB * //* RUNS ON THE LAST DAY OF EACH MONTH * //* * //********************************************* //SALES JOB (ACCT#),'SALES DEPT', // CLASS=A, // MSGCLASS=X, // NOTIFY=&SYSUID //* //*--- STEP 1: EXTRACT SALES DATA ---* //EXTRACT EXEC PGM=SALESEXT, // REGION=4M, // TIME=5 //* //SALESIN DD DSN=PROD.SALES.CURRENT, // DISP=SHR //SALESOUT DD DSN=WORK.SALES.EXTRACT, // DISP=(NEW,PASS,DELETE), // SPACE=(CYL,(10,5),RLSE), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=27920) //* //*--- STEP 2: GENERATE REPORTS ---* //REPORT EXEC PGM=SALESRPT, // COND=(0,LT,EXTRACT) //* //SALDATA DD DSN=WORK.SALES.EXTRACT, // DISP=(OLD,DELETE,DELETE) //RPTOUT DD SYSOUT=A, // DCB=(RECFM=FBA,LRECL=133,BLKSIZE=27930) //*

This example demonstrates good alignment, logical grouping with comments, consistent indentation, and descriptive naming.