Simple Mainframe Universe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 3: TSO Jobs


TSO- Jobs

TSO is interactive, but production work on the mainframe runs as batch jobs. TSO lets you submit a dataset or PDS member as a background job, check its status, cancel it if needed, and view its output — all from the READY prompt.

Writing the JCL first

  • A job is submitted from a dataset or PDS member containing JCL (Job Control Language).
  • Store your JCL in a PDS member, for example 'FSS094.JCL.CNTL(JOB1)', so you can resubmit it easily.
  • Every job needs a JOB card with your userid or an account number, plus EXEC and DD statements.
//FSS094A JOB (ACCT),'TEST JOB',CLASS=A,MSGCLASS=X,NOTIFY=FSS094
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DSN=FSS094.TEST.DATA,DISP=(NEW,CATLG),
// SPACE=(TRK,(1,1)),UNIT=SYSDA,DCB=(RECFM=FB,LRECL=80)

The SUBMIT command

  • SUBMIT sends a dataset or PDS member to JES as a background job.
  • TSO replies with the job name and a job id (for example JOB00012) that you need for the other commands.
  • The JOBCHAR operand changes the first character of the generated job name.
READY
SUBMIT 'FSS094.JCL.CNTL(JOB1)'
IKJ56250I JOB FSS094A(JOB00012) SUBMITTED
READY
SUBMIT 'FSS094.JCL.CNTL' JOBCHAR(A)
IKJ56250I JOB AFSS094A(JOB00013) SUBMITTED

The STATUS command

  • STATUS shows where your jobs are: on the input queue, executing, or on the output queue.
  • STATUS alone lists all your jobs. Give a job name and job id for detail on one job.
  • The origin field tells you which queue the job is in.
READY
STATUS
JOBNAME JOBID OWNER STATUS CLASS
FSS094A JOB00012 FSS094 OUTPUT A
READY
STATUS FSS094A(JOB00012)
JOBNAME JOBID OWNER STATUS CLASS
FSS094A JOB00012 FSS094 EXECUTION A

The CANCEL command

  • CANCEL stops a job that is waiting or executing.
  • You can cancel with the job name and job id, or with just the job name if it is unique.
  • The PURGE operand also removes the job's output from the spool.
READY
CANCEL FSS094A(JOB00012)
IKJ56247I JOB FSS094A(JOB00012) CANCELLED
READY
CANCEL FSS094A PURGE

The OUTPUT command

  • OUTPUT displays the spooled output of a finished job on your TSO screen.
  • Use DEST and CLASS operands to control which output you see.
  • KEEP leaves the output on the queue; without it, the output is removed after display.
READY
OUTPUT FSS094A(JOB00012)
********************************* TOP OF DATA **********************************
1IEF142I FSS094A STEP1 - STEP WAS EXECUTED - COND CODE 0000
******************************** BOTTOM OF DATA ********************************
READY
OUTPUT FSS094A(JOB00012) KEEP

Using SDSF from TSO

  • SDSF (System Display and Search Facility) is the full-screen way to watch jobs.
  • Type SDSF at the READY prompt to open it, then use ST for status, I for the input queue and O for the output queue.
  • Inside SDSF you can also cancel jobs (C line command) and browse output (S line command).
READY
SDSF

Reading return codes

  • COND CODE 0000 in the output means the step ran cleanly.
  • COND CODE 0004 is a warning, 0008 and 0012 usually mean errors worth investigating.
  • JCL errors show as JCL ERROR or FLUSHED before any step runs; fix the JCL and resubmit.





© copyright mainframebug.com
Privacy Policy
MainframeBug Assistant