Mainframe · JCL · JES2

What's in a Job Card?

jcl jes2 job-card

JCL is a staple language for Systems Programmers, and arguably the most important part of any JCL is the job card — we can't run a JCL without one.

The reason a lot of people call it a 'Job card' (you might also hear other terms like 'Job statement') is because MVS programming used to be done on punch cards. If you've never heard of a punch card, IBM has a nice history lesson on them.

To have a valid job card, you need at minimum a job name and the JOB keyword. That would look something like this:

//SAMPJOB JOB

But that gives us and JES absolutely no information about the job, which is where the positional and keyword parameters come in. They can be used to provide extra information such as the account that is running the job, who to notify upon job completion, what initiator class the job should use, and many other options. A more realistic job card would be something like this:

//JOBNUM1 JOB 504,SMITH PAYROLL, // CLASS=X,NOTIFY=&SYSUID, // REGION=0M

Positional Parameters

After the job statement, there are two positional parameters:

  • Job accounting information — in our example, 504
  • Programmer name field — in our example, SMITH PAYROLL

These positional parameters are not required unless your site has made it a rule.

Keyword Parameters

Then we get to the keyword parameters. Unlike positional parameters, these can go in any order because they all start with keyword= and the value is provided after. The most commonly used keyword parameters are:

CLASS — which JES initiator class the job should run under. Available initiators can be checked by going to the SDSF INIT panel. Sites usually assign initiators to specific batches — for example, class L might be for long-running jobs or class O might be for overnight jobs.

MSGCLASS — where the job output is printed to. Every system should have a class A by default, which points to the JES spool. If your site has other printers set up you may want to code in a different value.

MSGLEVEL — the amount of detail in the job output. Coded as MSGLEVEL=(N1,N2). N1 can be a value from 0–2 and N2 can be a value from 0–1 — the higher the number you specify, the more detail is provided. The system default is (1,1).

NOTIFY — the UID to notify with a TSO interrupt on job completion or failure. This can be hardcoded (e.g., NOTIFY=TSOUSR1) or the &SYSUID variable can be used, which substitutes in the UID of the user that submits the job.

REGION — the amount of central or virtual storage your job can use. Often, you will see REGION=0M which means the job is allowed to use as much storage as it needs. If your job does not have enough storage you may see an abend such as S878.

TIME — the maximum amount of CPU time (in minutes) the job can use. If the job runs for longer than this, it will be cancelled with an S522 abend.

A Realistic Example

//JOBNUM1 JOB 504,'SMITH PAYROLL',
//        CLASS=X,
//        MSGCLASS=A,
//        MSGLEVEL=(1,1),
//        NOTIFY=&SYSUID,
//        REGION=0M,
//        TIME=30

Need to insert a job card quickly while editing? Check out the Jobcard Template Insert Macro.