GET_JOB_INFO table function

The GET_JOB_INFO table function returns one row containing the information about a specific job.

Read syntax diagramSkip visual syntax diagramGET_JOB_INFO(job-name )
The schema is QSYS2.

To invoke this function, the caller must have *JOBCTL user special authority, or QIBM_DB_SQLADM or QIBM_DB_SYSMON function usage authority.

job-name
A character or graphic string expression that identifies the name of a job. The special value of '*' indicates the current job.

The result of the function is a table containing a single row with the format shown in the following table. All the columns are nullable.

Table 1. GET_JOB_INFO table function
Column Name Data Type Description
V_JOB_STATUS CHAR(10) Status of the job.
*ACTIVE
Job is active. It could be a group job, system request job, or disconnected job.
*COMPLETE
Job is complete and job status information is no longer accessible.
*JOBQ
Job is currently on job queue.
*OUTQ
Job has completed running but has output on an output queue or the job log has not yet been written.
V_ACTIVE_JOB _STATUS CHAR(4) The active status of the initial thread of the job.

For the list of values see Work Management API Attribute Descriptions in Application Programming Interfaces and search on "Active job status".

V_RUN_PRIORITY INTEGER The highest run priority allowed for any thread within this job.
V_SBS_NAME CHAR(10) Name of subsystem where job is running.
V_CPU_USED BIGINT The amount of CPU time (in milliseconds) that has been currently used by this job.
V_TEMP_STORAGE_USED_MB INTEGER The amount of auxiliary storage (in megabytes) that is currently allocated to this job.
V_AUX_IO_REQUESTED BIGINT The number of auxiliary I/O requests performed by the job across all routing steps. This includes both database and nondatabase paging.
V_PAGE_FAULTS BIGINT The number of times an active program referenced an address that was not in main storage during the current routing step of the specified job.
V_CLIENT_WRKSTNNAME CHAR(255) Value of the SQL CLIENT_WRKSTNNAME special register.
V_CLIENT_APPLNAME CHAR(255) Value of the SQL CLIENT_APPLNAME special register.
V_CLIENT_ACCTNG CHAR(255) Value of the SQL CLIENT_ACCTNG special register.
V_CLIENT_PROGRAMID CHAR(255) Value of the SQL CLIENT_PROGRAMID special register.
V_CLIENT_USERID CHAR(255) Value of the SQL CLIENT_USERID special register.
V_SQL_STATEMENT_TEXT VARCHAR(10000) Statement text of the last SQL statement to run or the SQL statement that is currently running.
V_SQL_STMT_STATUS CHAR(8) The status of SQL within this job.
ACTIVE
An SQL statement is currently running
COMPLETE
At least one SQL statement has run and has completed
Returns null if no SQL statement has been run.
V_SQL_STMT_START_TIMESTAMP TIMESTAMP The timestamp of the execution start for an active SQL statement. If there is no active SQL statement, the null value is returned.
V_QUERY_OPTIONS_LIB_NAME CHAR(10) The name of the QAQQINI options library in use for this job.
V_CLIENT_IP_ADDRESS VARCHAR(45) Client IP address being used by the job.

Returns null when no client IP address exists or the job is using IPv6.

V_PJ_REUSE_COUNT INTEGER The number of times the prestart job has been used. The prestart job reuse count is incremented when a disconnect is processed for a prestart job. When the prestart job reuse count exceeds the prestart job maximum number of uses, the job is ended.

Returns null if the job is not active or if the job is not a prestart job.

V_PJ_MAXUSE_COUNT INTEGER The maximum number of times the prestart job can be used before it is ended. A value of -1 is returned for *NOMAX.

Returns null if the job is not active or if the job is not a prestart job.

Example

Return information about job 347117/Quser/Qzdasoinit.

SELECT * FROM TABLE(QSYS2.GET_JOB_INFO('347117/Quser/Qzdasoinit')) A