How to Check Your DB2 Utility Job is Completed

In Zo/s, DB2 is prime RDBMS. After running utilities, you can see the status of that utility using DB2 CLI or Spool. Usually, developers run LOAD/UNLOAD utility (normally developers do). They check the job status in Spool. The other way is you can check in CLI.  

Logs at Spool

The Spool is the space allocated for logs in Zo/S. So Spool is there to check job status why CLI of DB2 you need?. You can use it to check the status of submitted utility jobs online/Batch.

Logs at DB2 CLI

-DISPLAY UTILITY(*)

Output

DSNU100I - DSNUGDIS - USERID = SAMPID
              MEMBER = 
              UTILID = RUNTS
              PROCESSING UTILITY STATEMENT 1
              UTILITY = RUNSTATS
              PHASE = RUNSTATS   COUNT = 0
              STATUS = STOPPED
              STATUS = STOPPED
              JOBNAME = STATSJB
DSN9022I - DSNUGCC  '-DISPLAY UTILITY' NORMAL COMPLETION

Here’s SAMPID, which tells userid submitted RUNSTATS utility. It’s final status is “Normal Completion”.

That means execution is completed normally. In interviews, you may ask a question that when to perform and who’ll perform. This is admin’s role not developer’s.

LOAD/UNLOAD

These two are top DB2 utility batch jobs submitted by developers. You can see the status of completion either in Spool or DB2 CLI.

DB2 Job Status

Pending States

In DB2, all the pending states while running utilities will happen on Table Space & Index Space. To continue your utility job progress, you need to reset by using any one of the methods & you need to re-run your job.

The check pending flag for the table space can be reset by:

  • Running the CHECK DATA utility for the tables in the table space specifying DELETE YES.
  • Running the CHECK DATA utility for the tables in the table space specifying DELETE NO if no constraint violations are encountered.
  • Running the LOAD utility specifying the ENFORCE CONSTRAINTS option.
  • Altering tables in the table space to drop foreign keys and check constraints.
  • Running the REPAIR utility specifying SET NOCHECKPEND for the table space or issuing the START command for the table space with the ACCESS(FORCE) parameter. Neither option corrects the problem flagged by the pending state; they merely reset the pending flag.

The copy pending flag for the table space can be reset by:

  • Running the REORG utility with the LOG YES option or running the LOAD utility with both the REPLACE and LOG YES options.
  • Running the COPY utility specifying both the SHRLEVEL REFERENCE and the FULL YES options.
  • Running the REPAIR utility specifying SET NOCOPYPEND for the table space or issuing the START command for the table space with the ACCESS(FORCE) parameter. Neither option corrects the problem flagged by the pending state; they merely reset the pending flag.

The recover pending flag for the table space can be reset by:

  • Running the LOAD utility with the REPLACE option.
  • Running a full recovery for the table space.
  • Running the REPAIR utility specifying SET NORCVRPEND for the table space or issuing the START command for the table space with the ACCESS(FORCE) parameter. Neither option corrects the problem flagged by the pending state; they merely reset the pending flag.

The recover pending flag for the index can be reset by:

  • Running the REBUILD INDEX utility for the index.
  • Running the RECOVER INDEX utility for the index.
  • Running the REPAIR utility specifying SET NORCVRPEND for the index or issuing the START command for the index with the ACCESS(FORCE) parameter. Neither option corrects the problem flagged by the pending state; they merely reset the pending flag.

Related Posts

Get new content delivered directly to your inbox.

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.