AS400 jobs (Batch job error handling) - skill-at/AS-400-Training GitHub Wiki

Some important commands :

1.The Work with Active Jobs (WRKACTJOB) command allows you to work with performance and status information for the active jobs in the system.

WRKACTJOB This will give active job details of all subsystems. WRKACTJOB SBS(SUBSYSTEM Name) This will give active job details of a particular subsystem.

2.The Work with User Jobs (WRKUSRJOB) command allows you to work with a list of selected user jobs.

3.WRKSBMJOB : The Work with Submitted Jobs (WRKSBMJOB) command allows you to work with all jobs submitted from your work station, job, or user profile

To check batch jobs in error

Usually qsysopr message queue contains error details. To check error messages on sysopr or any other message queue use DSPMSG command followed by message queue name.

  1. DSPMSG *SYSOPR or DSPMSG QSYSOPR will provide job errors.
  2. Take option 5 and check error messages. Take F10 and get job name
  3. Check job using wrkjob command , wrkjob job name
  4. Check call stack to see current pgm in error , by option 11
  5. Take option 10 to check job log
  6. If its decimal data error , take option 14 and get rrn from open files for file currently used in errored program statement.
  7. If program has created dump take option 4 and see dump spool file.

if CL program is in error it gives below reply option for that error. C : Cancel existing program. D: It will cancel program and produce dump.(spool file which will give information on error) I : It will ignore failing command and go ahead with next command. R : It will retry failing command. This option is usually taken for locks. Once lock is removed R is taken to retry failing command.

if RPGLE program is in error it gives below reply option for that error. C : Cancel existing program. G : GETIN , with this option code will again start from first Calculation specification. This is usually taken if rpgle program is in error with decimal data (junk record) and program has sequential read. With this option next record will be read. D : Cancel existing program and create dump. F : Cancel existing program and create fully formatted dump.

Command to check for locks
WRKOBJLCK : To check if object is in use by other process or job. DSPRCDLCK : To check record locks.