Finding interrupted batch jobs

Status code in CJBCTL

A status field is supplied to monitor the execution of the job in the CJBCTL table.

A batch job can have one of these statuses:

  • 00 = Job is waiting for execution. This status is set when the job is submitted.
  • 10 = Job is on-hold. On-hold jobs are not executed and can only be restarted or canceled. This status is set through (MNS321).
  • 15 = Start of job failed. This status is set by CMNGJOB.
  • 20 = Job is executing /active, or actually started, not finished.
  • 25 = Job has finished abnormally (a dump log has been created).
  • 26 = Job has finished by shut down of the subsystem . The job needs to be restarted.
  • 30 = Job has finished in a normal way (OK).
  • 90 = Job is canceled. Jobs that have been canceled cannot be restarted. This status is set through (MNS321).

CMNGJOB checks at short intervals if any job with status 00 is available, and if it can start in the requested job queue according to the limits set on the job queue and subsystem activity level. If so, the job is started and the status is set to 20. If a technical failure is detected, so the job cannot be started, the status is set to 15. A technician must analyze what caused the problem.

If the application program dumps during execution, the status of the job is set to 25, and an analysis is required. The cause can be a program error, settings or parameters errors, or an error in the database.

If the job is completed normally, the status is set to 30 and the job is finished.

Function to display interrupted jobs

You can view the contents of the job control file CJBCTL and job command file using 'Job. Connect to Job Queue' (MNS310) and 'Submitted Job. Open' (MNS250). By filtering on status in 'Job. Display History' (MNS320), the interrupted jobs are displayed and examined.

Several list views exist in the program:

  • The file can be viewed for a specific job queue, job queue priority, user, user and date, or date.
  • 'Submitted Job. Open' (MNS250) can be used to show details in file CJBCMD and be viewed by job number, job (file), user, or date.

Managing newly submitted jobs

Selection program 'Job. Select Operation' (MNS321) can do changes for single or multiple jobs in CJBCTL, which are displayed in 'Job. Display History' (MNS320), simultaneously. These operations can be initiated depending on the selection criteria:
  • 1 - Change the priority - to change the priority of the new jobs which takes effect once CMNGJOB starts.
  • 2 - Put on-hold - to put new jobs in 10 status.
  • 3 - Restart on-hold jobs - to reset on-hold jobs back to 00 status. You can also restart a job directly in (MNS320) through related option 20='Restart'. See Restarting batch jobs.
  • 4 - Cancel on-hold jobs - to cancel on-hold jobs and put them in status 90-'Canceled'.
  • 5 - Retry jobs that failed to start – to reset jobs with 15-'Can not start' status back to 00 status.

The selection can be based on the job attributes such as job number, entry date, job name, job queue, job queue priority, and user.

Aside from manually filling in the selection fields, you can automatically populate these fields by using the selected job number attributes. To do this, click Populate selection or use the F14 function.

You can open (MNS321) from 'Job Queue. Open' (MNS300) and (MN320) using F17='Select operation'.