What a Job Is
Part of the Batch Jobs with JCL section of Coddy's COBOL Programming journey. Lesson 1 of 19.
Banks do much of their work in batch: programs that run with no one at a keyboard, often at night, reading the day's data and writing reports. On an IBM mainframe, the operating system z/OS runs them as jobs.
A job is written in JCL, Job Control Language. It names the job and lists its steps, the programs to run, in order:
//DAYSTART JOB (ACCT),'CODDY',CLASS=A,MSGCLASS=X
//OPEN EXEC PGM=OPENDAY
//SYSOUT DD SYSOUT=*Every JCL line starts with //. The JOB statement names the job, DAYSTART. Each EXEC statement is a step that runs one program, here OPENDAY, and the DD statement says where the program's output goes.
JES2, the part of z/OS that takes in jobs and keeps their output, writes a job log as the job runs:
IEF403I DAYSTART - STARTED
IEF142I DAYSTART OPEN - STEP WAS EXECUTED - COND CODE 0000
IEF404I DAYSTART - ENDED
$HASP395 DAYSTART ENDED - RC=0000Each line starts with a message id. IEF142I says the step ran and ended with code 0000, and $HASP395 says the job ended.
Below the log, this course prints what each step wrote, under a line naming the step and the DD. On a mainframe you open each output in a tool such as SDSF.
Challenge
EasyThe job is named MYJOB. Rename it DAYSTART on its first line, so every line of the log names DAYSTART.
Try it yourself
//MYJOB JOB (ACCT),'CODDY',CLASS=A,MSGCLASS=X
//OPEN EXEC PGM=OPENDAY
//SYSOUT DD SYSOUT=*
All lessons in Batch Jobs with JCL
Practice on your own: Online COBOL compiler