---
title: "JCL and procedures"
---

# JCL and procedures

JCL read as z/OS reads it, its outline, links, hover and completion, cataloged procedures and INCLUDE members from local folders and host PROCLIBs, and Generate Run JCL for a program.

**Verification state:** the JCL reader and language features are the module's own code, **verified on Linux** by unit and rendering tests on the payroll sample and AWS CardDemo; hover and completion were checked in the running app. They are **not compared with JES's own JCL checking on z/OS**: JES remains the authority. Procedures read from host PROCLIBs are tested against the z/OSMF-shaped server, **not yet run against z/OS**. Generated run JCL has **not yet been submitted on z/OS**.

## JCL as z/OS reads it

Continuations, in-stream data, symbols, COND and IF/THEN/ELSE evaluation. Syntax problems appear on their lines in Problems as you edit the member.

- **Outline:** the job, in-stream procedures, steps with PGM or PROC, DDs with their concatenations.
- **Go to Definition and links** from `PGM=` to the COBOL program, from `EXEC procedure` and `INCLUDE MEMBER=` to the member, and from `DSN=` to the local file `datasets` maps it to (SET symbols replaced).
- **Folding:** the job, PROC to PEND, steps, DD concatenations, in-stream data, IF and ELSE, comment blocks.

### Hover

| On | Shows |
|---|---|
| A DD | Its step and program, the local file and whether it exists, DISP with the defaults, how the programs open it |
| `DSN=` | The steps that create, write, read and delete the data set |
| `PGM=` | The program's source and the DD names it needs |

![Hover on a DD statement in an AWS CardDemo job: the step and program, the data set's local file, DISP explained and how the program opens the file.](https://neuralinverse.com/docs-images/modules/mainframe/jcl-dd-hover.webp)

### Completion

JOB, EXEC and DD keywords, and the values of DISP, SPACE, DCB, RECFM, DSORG, DSNTYPE, SYSOUT, TYPRUN and COND.

![Completion of DISP values on a new DD statement in a sample job.](https://neuralinverse.com/docs-images/modules/mainframe/jcl-disp-completion.webp)

## Procedures and INCLUDE members

Cataloged procedures and INCLUDE members are found in this order:

1. the local procedure folders (`procedures` in `mainframe.json`; by default folders named PROCLIB, PROC, PROCS or JCL);
2. while a connection exists, the libraries a JCLLIB names that no local folder stands for;
3. then `host.procedureLibraries`.

Host members are read through the host copybook cache. They are used by the application map, local runs, JCL hover and Go to Definition. Procedures are expanded as the application map expands them: in-stream and cataloged, nested, symbols, PARM and COND overrides, DD overrides and additions, INCLUDE, JCLLIB ORDER.

## Generate Run JCL

**Generate Run JCL** on a COBOL program writes a job to run it, as IDz generates one from the property group:

- a DD for every file, from its SELECT, FD and OPEN mode: INPUT as SHR, I-O as OLD, EXTEND as MOD, OUTPUT as NEW with SPACE and DCB from the record length; VSAM without SPACE or DCB; a file never opened as DUMMY; a print file to SYSOUT;
- the files of the programs it CALLs;
- the PARM length from USING, on a SET line;
- SYSIN when the program ACCEPTs;
- the project's `datasets` and load library;
- a Db2 program under IKJEFT01.

CICS and IMS programs are refused with the reason. Every choice is stated in a comment, and a header says the job is yours. The job opens unsaved, with Submit offered through the usual [submit confirmation](https://neuralinverse.com/docs/modules/mainframe/jobs/#submit-a-job). A rerun needs the new data sets deleted first; the job says so.

Verified on Linux against the payroll job and every CardDemo job that runs a batch program: all its DDs present, and the LRECL and RECFM of each new data set matching.
