Start of change

JOB_QUEUE_ENTRIES view

The JOB_QUEUE_ENTRIES view returns one row for each entry in a job queue.

Authorization: See Note below.

The following table describes the columns in the view. The system name is JOBQ_ENT. The schema is SYSTOOLS.

Table 1. JOB_QUEUE_ENTRIES view
Column Name System Column Name Data type Description
JOB_QUEUE_LIBRARY JOBQ_LIB VARCHAR(10) The name of the library containing the job queue.
JOB_QUEUE_NAME JOBQ VARCHAR(10) The name of the job queue that the job is currently on.
JOB_QUEUE_STATUS STATUS VARCHAR(9) The status of this job on the job queue.
HELD
This job is being held on the job queue.
RELEASED
This job is ready to be selected.
SCHEDULED
This job will run as scheduled.
JOB_NAME JOB_NAME VARCHAR(28) The qualified job name.
JOB_NAME_SHORT JOB_NAME_S VARCHAR(10) The name of the job.
JOB_USER JOB_USER VARCHAR(10) The user profile that started the job.
JOB_NUMBER JOB_NUMBER VARCHAR(6) The job number of the job.
JOB_TYPE JOB_TYPE VARCHAR(3) The type of job.
ASJ
Autostart
BCH
Batch
BCI
Batch Immediate
EVK
Started by a procedure start request
INT
Interactive
M36
Advanced 36 server job
MRT
Multiple requester terminal
PDJ
Print driver job
PJ
Prestart job
RDR
Spool reader
SBS
Subsystem monitor
SYS
System
WTR
Spool writer
JOB_TYPE_ENHANCED JOBT_ENH VARCHAR(28) The combined job type and job subtype values.
ALTERNATE_SPOOL_USER
Batch - alternate spool user
AUTOSTART
Autostart job
BATCH
Batch job
BATCH_IMMEDIATE
Batch immediate job
BATCH_MRT
Batch - System/36 multiple requester terminal (MRT) job
COMM_PROCEDURE_START_REQUEST
Communications job - procedure start request job
INTERACTIVE
Interactive job
INTERACTIVE_GROUP
Interactive job - Part of group
INTERACTIVE_SYSREQ
Interactive job - Part of system request pair
INTERACTIVE_SYSREQ_AND_GROUP
Interactive job - Part of system request pair and part of a group
PRESTART
Prestart job
PRESTART_BATCH
Prestart batch job
PRESTART_COMM
Prestart communications job
READER
Reader job
SUBSYSTEM
Subsystem job
SYSTEM
System job (all system jobs including SCPF)
WRITER
Writer job (including both spool writers and print drivers)
JOB_DATE JOB_DATE VARCHAR(10) The date that is assigned to the job, in *ISO format. The job date remains the same for the duration of the job unless it is changed by the user. Can also contain the following special value:
SYSVAL
This job will use the system date.
JOB_DESCRIPTION_LIBRARY JOBDLIB VARCHAR(10)
Nullable
The name of the library containing the job description.

Contains the null value if JOB_DESCRIPTION is null.

JOB_DESCRIPTION JOBD VARCHAR(10)
Nullable
The name of the job description used for this job.

Contains the null value if the job has no job description.

JOB_ACCOUNTING_CODE ACGCDE VARCHAR(15)
Nullable
An identifier assigned to the job by the system to collect resource use information for the job when job accounting is active.

Contains the null value if the job has no accounting code.

SUBMITTER_JOB_NAME SBMJOBNAME VARCHAR(28)
Nullable
The qualified job name of the submitter's job.

Contains the null value if the job has no submitter.

SUBMITTER_MESSAGE_QUEUE_LIBRARY SBMMSGQLIB VARCHAR(10)
Nullable
The name of the library containing the message queue.

Contains the null value if the job has no submitter.

SUBMITTER_MESSAGE_QUEUE SBMMSGQ VARCHAR(10)
Nullable
The name of the message queue where the system sends a completion message when a batch job ends.

Contains the null value if the job has no submitter.

SERVER_TYPE SERVERTYPE VARCHAR(30)
Nullable
The type of server represented by the job. See Server table for a list of server type values.

Contains the null value if the job is not part of a server.

JOB_ENTERED_SYSTEM_TIME ENTER_TIME TIMESTAMP(0) The timestamp for when the job was placed on the system.
JOB_SCHEDULED_TIME JOB_SCHEDT TIMESTAMP(0)
Nullable
The timestamp for when the job is scheduled to become active.

Contains the null value if this is not a scheduled job.

JOB_END_SEVERITY JOB_ENDSEV INTEGER The message severity level of escape messages that can cause a batch job to end. The batch job ends when a request in the batch input stream sends an escape message, whose severity is equal to or greater than this value, to the request processing program.
JOB_QUEUE_PRIORITY JOBQ_PRI INTEGER The scheduling priority of the job compared to other jobs on the same job queue. The highest priority is 0 and the lowest is 9.
JOB_QUEUE_TIME JOBQ_TIME TIMESTAMP(0) The timestamp when the job was put on the job queue.
JOB_MESSAGE_QUEUE_MAXIMUM_SIZE MSGQ_MAX INTEGER The maximum size, in megabytes, that the job message queue can become. The range is 2 to 64.
JOB_MESSAGE_QUEUE_FULL_ACTION MSGQ_FULL VARCHAR(8) The action to take when the message queue is full.
*NOWRAP
When the job message queue is full, do not wrap. This action causes the job to end.
*PRTWRAP
When the job message queue is full, wrap the message queue and print the messages that are being overlaid because of the wrapping.
*WRAP
When the job message queue is full, wrap to the beginning and start filling again.
ALLOW_MULTIPLE_THREADS ALWMLTTHD VARCHAR(3) Indicates whether this job allows multiple user threads. This attribute does not prevent the operating system from creating system threads in the job.
NO
This job does not allow multiple user threads.
YES
This job allows multiple user threads.
DEFAULT_WAIT DFT_WAIT INTEGER
Nullable
The default maximum time, in seconds, that a thread in the job waits for a system instruction, such as a LOCK machine interface (MI) instruction, to acquire a resource.

Contains the null value if there is no maximum or if a value has not been set for the job.

MAXIMUM_PROCESSING_TIME_
ALLOWED
MAX_TIME INTEGER
Nullable
The maximum processing unit time, in milliseconds, that the job can use. If the job consists of multiple routing steps, this is the maximum processing unit time that the current routing step can use. If the maximum time is exceeded, the job is held.

Contains the null value if no maximum amount of processing unit time has been defined.

MAXIMUM_TEMPORARY_STORAGE_
ALLOWED
MAX_STG INTEGER
Nullable
The maximum amount of auxiliary storage, in megabytes, that the job can use. If the job consists of multiple routing steps, this is the maximum temporary storage that the routing step can use. This temporary storage is used for storage required by the program itself and by implicitly created internal system objects used to support the routing step. (It does not include storage for objects in the QTEMP library.) If the maximum temporary storage is exceeded, the job is held. This does not apply to the use of permanent storage, which is controlled through the user profile.

Contains the null value if no maximum amount of temporary storage has been defined.

TIME_SLICE TIME_SLICE INTEGER
Nullable
The maximum amount of processor time, in milliseconds, given to each thread in this job before other threads in this job and in other jobs are given the opportunity to run. The time slice establishes the amount of time needed by a thread in this job to accomplish a meaningful amount of processing. At the end of the time slice, the thread might be put in an inactive state so that other threads can become active in the storage pool. Values range from 8 through 9999999.

Contains the null value if a value has not been set for the job.

JOB_SWITCHES SWITCHES CHAR(8)
Nullable
The current setting of the job switches used by this job.

Contains the null value no job switches are set.

ROUTING_DATA RTGDTA VARCHAR(80)
Nullable
The routing data that is used to determine the routing entry that identifies the program to start for the routing step.

Contains the null value if there is no routing data for this job.

CCSID CCSID INTEGER
Nullable
The coded character set identifier (CCSID) used for this job.

Contains the null value if no CCSID is defined for this job.

CHARACTER_IDENTIFIER_CONTROL CHRIDCTL VARCHAR(9) The character identifier control for the job. This attribute controls the type of CCSID conversion that occurs for display files, printer files, and panel groups. The *CHRIDCTL special value must be specified on the CHRID command parameter on the create, change, or override command for display files, printer files, and panel groups before this attribute will be used.
*DEVD
The *DEVD special value performs the same function as on the CHRID command parameter for display files, printer files, and panel groups.
*JOBCCSID
The *JOBCCSID special value performs the same function as on the CHRID command parameter for display files, printer files, and panel groups.
SORT_SEQUENCE_LIBRARY SRTSEQ_LIB VARCHAR(10)
Nullable
The name or the library that contains the sort sequence table.

Contains the null value if no sort sequence table is defined for this job or if SORT_SEQUENCE_NAME is a special value.

SORT_SEQUENCE_NAME SRTSEQ VARCHAR(10)
Nullable
The name of the sort sequence table associated with this job.

Contains the null value if no sort sequence table is defined for this job.

LANGUAGE_ID LANGID CHAR(3) The language identifier associated with this job.
COUNTRY_ID COUNTRY_ID CHAR(2) The country or region identifier associated with this job.
DATE_FORMAT DATFMT CHAR(4) The date format used for this job.
*DMY
Day, month, year format.
*JUL
Julian format (year and day).
*MDY
Month, day, year format.
*YMD
Year, month, day format.
DATE_SEPARATOR DATSEP CHAR(1) The date separator used for this job.
TIME_SEPARATOR TIMSEP CHAR(1) The time separator used for this job.
DECIMAL_FORMAT DECFMT VARCHAR(6) The decimal format used for this job.
*BLANK
Uses a period for a decimal point, a comma for a 3-digit grouping character, and zero-suppress to the left of the decimal point.
J
Uses a comma for a decimal point and a period for a 3-digit grouping character. The zero-suppression character is in the second position (rather than the first) to the left of the decimal notation. Balances with zero values to the left of the comma are written with one leading zero (0,04). The J entry also overrides any edit codes that might suppress the leading zero.
I
Uses a comma for a decimal point, a period for a 3-digit grouping character, and zero-suppress to the left of the decimal point.
TIME_ZONE_DESCRIPTION_NAME TIME_ZONE VARCHAR(10) The name of the time zone description that is used to calculate local job time.
MESSAGE_LOGGING_LEVEL LOG_LEVEL INTEGER The type of information that is logged.
0
No messages are logged.
1
All messages sent to the job's external message queue with a severity greater than or equal to the message logging severity are logged. This includes the indication of job start, job end and job completion status.
2
The following information is logged:
  • Level 1 information
  • Request messages that result in a high-level message with a severity code greater than or equal to the logging severity cause the request message and all associated messages to be logged.

    Note: A high-level message is one that is sent to the program message queue of the program that receives the request message. For example, QCMD is an IBM®-supplied request processing program that receives request messages.

3
The following information is logged:
  • Level 1 and 2 information
  • All request messages
  • Commands run by a CL program are logged if it is allowed by the logging of CL programs job attribute and the log attribute of the CL program.
4
The following information is logged:
  • All request messages and all messages with a severity greater than or equal to the message logging severity, including trace messages.
  • Commands run by a CL program are logged if it is allowed by the logging of CL programs job attribute and the log attribute of the CL program.
MESSAGE_LOGGING_SEVERITY LOG_SEV INTEGER The severity level that is used in conjunction with the logging level to determine which error messages are logged in the job log. The values range from 0 through 99.
MESSAGE_LOGGING_TEXT LOG_TEXT VARCHAR(7) The level of message text that is written in the job log when a message is logged according to the logging level and logging severity.
*MSG
Only the message text is written to the job log.
*NOLIST
If the job ends normally, no job log is produced. If the job ends abnormally (the job end code is 20 or higher), a job log is produced. The messages that appear in the job log contain both the message text and the message help.
*SECLVL
Both the message text and the message help (cause and recovery) of the error message are written to the job log.
LOG_CL_PROGRAM_COMMANDS LOG_CL VARCHAR(4) Specifies whether or not commands are logged for CL programs that are run.
*NO
Commands are not logged.
*YES
Commands are logged.
STATUS_MESSAGE STATUS_MSG VARCHAR(7) Specifies whether status messages are displayed for this job.
*NONE
This job does not display status messages.
*NORMAL
This job displays status messages.
INQUIRY_MESSAGE_REPLY INQ_REPLY VARCHAR(8) Specifies how the job answers inquiry messages.
*RQD
The job requires an answer for any inquiry messages that occur while this job is running.
*DFT
The system uses the default message reply to answer any inquiry messages issued while this job is running. The default reply is either defined in the message description or is the default system reply.
*SYSRPYL
The system reply list is checked to see if there is an entry for an inquiry message issued while this job is running. If a match occurs, the system uses the reply value for that entry. If no entry exists for that message, the system uses an inquiry message.
BREAK_MESSAGE BREAK_MSG VARCHAR(7) Specifies how this job handles break messages.
*HOLD
The message queue holds break messages until a user or program requests them. The work station user uses the Display Message (DSPMSG) command to display the messages; a program must issue a Receive Message (RCVMSG) command to receive a message and handle it.
*NORMAL
The message queue status determines break message handling.
*NOTIFY
The system notifies the job's message queue when a message arrives. For interactive jobs, the audible alarm sounds if there is one, and the message-waiting light comes on.
JOB_LOG_OUTPUT JOBLOG_OUT VARCHAR(10) Specifies how the job log will be produced when the job completes.
*JOBEND
The job log will be produced by the job itself. If the job cannot produce its own job log, the job log will be produced by a job log server. For example, a job does not produce its own job log when the system is processing a Power Down System (PWRDWNSYS) command.
*JOBLOGSVR
The job log will be produced by a job log server. For more information about job log servers, refer to the Start Job Log Server (STRLOGSVR) command.
*PND
The job log will not be produced. The job log remains pending until removed.
OUTPUT_QUEUE_PRIORITY OUTQ_PRI INTEGER The output priority for spooled output files that this job produces. The highest priority is 0, and the lowest is 9.
OUTPUT_QUEUE_LIBRARY OUTQLIB VARCHAR(10) The name of the library that contains the default output queue.
OUTPUT_QUEUE_NAME OUTQ VARCHAR(10) The name of the default output queue that is used for spooled output produced by this job and the name of the library that contains the output queue. The default output queue is only for spooled printer files that specify *JOB for the output queue.
SPOOLED_FILE_ACTION SPOOL_ACT VARCHAR(7) Specifies whether spooled files are accessed through job interfaces after the job has completed is normal activity.
*DETACH
The spooled files are detached from the job when the job completes its activity.
*KEEP
When the job completes its activity, as long as at least one spooled file for the job exists in the system auxiliary storage pool (ASP 1) or in a basic user ASP (ASPs 2-32), the spooled files are kept with the job and the status of the job is updated to indicate that the job has completed. If all remaining spooled files for the job are in independent ASPs (ASPs 33-255), the spooled files will be detached from the job and the job will be removed from the system.
PRINTER_DEVICE_NAME DEV_NAME VARCHAR(10) The printer device used for printing output from this job.
PRINT_KEY_FORMAT PRINT_KEY VARCHAR(7) Specifies whether border and header information is provided when the Print key is pressed.
*NONE
The border and header information is not included with output from the Print key.
*PRTBDR
The border information is included with output from the Print key.
*PRTHDR
The header information is included with output from the Print key.
*PRTALL
The border and header information is included with output from the Print key.
PRINT_TEXT PRINT_TEXT VARCHAR(30)
Nullable
The line of text that is printed at the bottom of each page of printed output for the job.

Contains the null value if there is no text defined to print at the bottom of each page.

DDM_CONVERSATION DDM_CONV VARCHAR(5) Specifies whether connections using distributed data management (DDM) protocols remain active when they are not being used. The connections include APPC conversations, active TCP/IP connections or Opti-Connect connections.
*DROP
The system ends a DDM connection when there are no users. Examples include when an application closes a DDM file, or when a DRDA application runs a SQL DISCONNECT statement.
*KEEP
The system keeps DDM connections active when there are no users, except for the following:
  • The routing step ends on the source system. The routing step ends when the job ends or when the job is rerouted to another routing step.
  • The Reclaim Distributed Data Management Conversation (RCLDDMCNV) command or the Reclaim Resources (RCLRSC) command runs.
  • A communications failure or an internal failure occurs.
  • A DRDA connection to an application server not running on the system ends.
MODE_NAME MODE_NAME VARCHAR(8)
Nullable
The mode name of the advanced program-to-program communications device that started the job. The following special value may be returned:
*BLANK
The mode name is a blank name.

Contains the null value if the job is not using advanced program-to-program communications (APPC).

UNIT_OF_WORK_ID UWID CHAR(24)
Nullable
The unit of work ID is used to track jobs across multiple systems.

Contains the null value if the job is not associated with a source or target system using advanced program-to-program communications (APPC).

INTERNAL_JOB_ID JOB_ID BINARY(16) The internal job identifier.

Note

This function is provided in the SYSTOOLS schema as an example of how to create a view based on information from a table function. Similar to other Db2® for i provided tools within SYSTOOLS, the SQL source can be extracted and used as a model for building similar helper functions, or to create a customized version within a user-specified schema.

Services provided in SYSTOOLS have authorization requirements that are determined by the interfaces used to implement the service. To understand the authority requirements, extract the SQL for the service and examine the implementation.

Example

List all the jobs on the APP1/BATCHJQ job queue.
SELECT * FROM SYSTOOLS.JOB_QUEUE_ENTRIES 
  WHERE JOB_QUEUE_LIBRARY = 'APP1' AND JOB_QUEUE_NAME = 'BATCHJQ';
End of change