JOB_DESCRIPTION_INFO view
The JOB_DESCRIPTION_INFO view returns information about job descriptions.
The values returned for the columns in the view are closely related to the values returned by the Display Job Description (DSPJOBD) CL command and the Retrieve Job Description Information (QWDRJOBD) API.
- *EXECUTE authority to the library containing the job description, and
- *OBJOPR and *READ authorities to the job description.
The following table describes the columns in the view. The system name is JOBD_INFO. The schema is QSYS2.
Column Name | System Column Name | Data Type | Description |
---|---|---|---|
JOB_DESCRIPTION_LIBRARY | JOBDLIB | VARCHAR(10) | The name of the library in which the job description resides. |
JOB_DESCRIPTION | JOBD | VARCHAR(10) | The name of the job description about which information is being returned. |
AUTHORIZATION_NAME | USER_NAME | VARCHAR(10) | The name of the user profile associated with this job
description. Can contain the following special value:
|
JOB_DATE | JOB_DATE |
DATE
Nullable |
The date that will be assigned to jobs using this job description
when they are started. Contains the null value if this job will use the QDATE system value. |
ACCOUNTING_CODE | ACGCDE | VARCHAR(15) | An identifier assigned to jobs that use this job description.
This code is used to collect system resource use information. Can contain the following special value:
|
ROUTING_DATA | RTGDTA | VARCHAR(80) | The routing data that is used with this job description to start
jobs. Can contain one of the following special values:
|
REQUEST_DATA | RQSDTA |
VARCHAR(256)
Nullable |
The request data that is placed as the last entry in the job's
message queue for jobs that use this job description. Can contain the following special value:
Contains the null value if no request data is placed in the job's message queue. |
LIBRARY_LIST_COUNT | LIBL_COUNT | INTEGER | The number of libraries in the user portion of the initial library list. |
LIBRARY_LIST | LIBL |
VARCHAR(2750)
Nullable |
The initial library list that is used for jobs that use this job
description. Only the libraries in the user portion of the library list are included. The list is an
array of 11 character entries. Each entry contains a ten character name followed by one blank. Can
contain the following special value:
Contains the null value is there is no initial library list. |
JOB_SWITCHES | SWITCHES | CHAR(8) | The initial settings for a group of eight job switches used by jobs that use this job description. These switches can be set or tested in a program and used to control a program's flow. The possible values are '0' (off) and '1' (on). |
TEXT_DESCRIPTION | TEXT |
VARCHAR(50)
Nullable |
The user text, if any, used to briefly describe the job
description. Contains the null value is there is no descriptive text. |
JOB_QUEUE_LIBRARY | JOBQLIB | VARCHAR(10) | The library of the job queue into which batch jobs using this job description are placed. |
JOB_QUEUE | JOBQ | VARCHAR(10) | The name of the job queue into which batch jobs using this job description are placed. |
JOB_QUEUE_PRIORITY | JOBQ_PRI | SMALLINT | The scheduling priority of each job that uses this job description. The highest priority is 1 and the lowest priority is 9. |
HOLD_ON_JOB_QUEUE | JOBQ_HOLD | VARCHAR(4) | Whether jobs using this job description are put on the job queue
with a status of held.
|
OUTPUT_QUEUE_LIBRARY | OUTQLIB |
VARCHAR(10)
Nullable |
The name of the library in which the output queue
resides. Contains the null value if OUTPUT_QUEUE is a special value. |
OUTPUT_QUEUE | OUTQ | VARCHAR(10) | The name of the default output queue that is used for spooled
output produced by jobs that use this job description. Can contain one of the following special values:
|
OUTPUT_QUEUE_PRIORITY | OUTQ_PRI | SMALLINT | The output priority for spooled files that are produced by jobs using this job description. The highest priority is 1, and the lowest priority is 9. |
SPOOLED_FILE_ACTION | SPOOL_ACT | VARCHAR(7) | Specifies whether spooled files can be accessed through job
interfaces once a job has completed its normal activity.
|
PRINTER_DEVICE | DEV_NAME | VARCHAR(10) | The name of the printer device that is used for all spooled
files created by jobs that use this job description. Can contain one of the following special values:
|
PRINT_TEXT | PRINT_TEXT |
VARCHAR(30)
Nullable |
The line of text that is printed at the bottom of each page of
printed output for jobs using this job description. Can contain the following special value:
Contains the null value if there is no text to print. |
JOB_MESSAGE_QUEUE
_MAXIMUM_SIZE |
MSGQ_MAX |
SMALLINT
Nullable |
The maximum size (in megabytes) of the job message queue. The
possible values are 2 to 64. Contains the null value if the maximum size is set by system value QJOBMSGQMX at the time the job is started. |
JOB_MESSAGE_QUEUE_FULL
_ACTION |
MSGQ_FULL | VARCHAR(8) | The action taken when the job message queue becomes full.
|
SYNTAX_CHECK_SEVERITY | SYNTAX |
SMALLINT
Nullable |
Whether requests placed on the job's message queue are checked
for syntax as CL commands, and the message severity that causes a syntax error to end processing of
a job. The possible values are:
Contains the null value if the request data is not checked for syntax as CL commands. This is equivalent to *NOCHK. |
JOB_END_SEVERITY | JOB_ENDSEV | SMALLINT | 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. The possible values are from 0 through 99. |
JOBLOG_OUTPUT | JOBLOG_OUT | VARCHAR(10) | How the job log will be produced when the job completes. This
does not affect job logs produced when the message queue is full and the job message queue full
action specifies *PRTWRAP. Messages in the job message queue are written to a spooled file, from
which the job log can be printed, unless the Control Job Log Output (QMHCTLJL) API was used in the
job to specify that the messages in the job log are to be written to a database file. The job log output value can be changed at any time until the job log has been produced or removed. To change the job log output value for a job, use the Change Job (QWTCHGJB) API or the Change Job (CHGJOB) command. The job log can be displayed at any time until the job log has been produced or removed. To display the job log, use the Display Job Log (DSPJOBLOG) command. The job log can be removed when the job has completed and the job log has not yet been produced or removed. To remove the job log, use the Remove Pending Job Log (QWTRMVJL) API or the End Job (ENDJOB) command. The possible values are:
|
INQUIRY_MESSAGE_REPLY | INQ_REPLY | VARCHAR(8) | How inquiry messages are answered for jobs that use this job description.
|
MESSAGE_LOGGING_LEVEL | LOG_LEVEL | SMALLINT | The type of information logged.
|
MESSAGE_LOGGING_SEVERITY | LOG_SEV | SMALLINT | The severity level that is used in conjunction with the logging level to determine which error messages are logged in the job log. The possible values are 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.
|
LOG_CL_PROGRAM_COMMANDS | LOG_CL | VARCHAR(4) | Whether or not commands are logged for CL programs that are run.
|
DEVICE_RECOVERY_ACTION | DEVRECOVER | VARCHAR(13) | The action to take when an I/O error occurs for the interactive
job's requesting program device.
|
TIME_SLICE_END_POOL | TIME_SLICE | VARCHAR(7) | Whether interactive jobs using this job description should be
moved to another main storage pool when they reach time-slice end.
|
ALLOW_MULTIPLE_THREADS | ALWMLTTHD | VARCHAR(4) | Whether or not the job is allowed to run with multiple user
threads. This attribute does not prevent the operating system from creating system threads in the
job. This attribute is not allowed to be changed once a job starts. This attribute applies to
autostart jobs, prestart jobs, batch jobs submitted from job schedule entries, and jobs started by
using the Submit Job (SBMJOB) and Batch Job (BCHJOB) commands. This attribute is ignored when
starting all other types of jobs. This attribute should be set to *YES only in job descriptions that
are used exclusively with functions that create multiple user threads.
|
WORKLOAD_GROUP | WRK_GROUP |
VARCHAR(10)
Nullable |
The name of the workload group that is used for jobs that use
this job description. Can contain the following special value:
Contains the null value if jobs using this job description do not have a defined workload group. |
ASPGRP | ASPGRP |
VARCHAR(10)
Nullable |
The name of the ASP group. This is the name of the primary ASP
device in an ASP group or the name of an ASP device description. This specifies the initial ASP
group setting for jobs using this job description. Contains the null value if jobs using this job description do not have an initial ASP group. |
DDM_CONVERSATION | DDM_CONV | VARCHAR(5) | Whether the Distributed Data Management conversations are kept or
dropped when they are not being used. The possible values are:
|
Examples
- Review information about the job queues associated with each job
description.
SELECT JOB_DESCRIPTION_LIBRARY, JOB_DESCRIPTION, JOB_QUEUE_LIBRARY, JOB_QUEUE, JOB_QUEUE_PRIORITY FROM QSYS2.JOB_DESCRIPTION_INFO;
- Find the job descriptions that have APPLIB1 in their library
list
SELECT JOB_DESCRIPTION_LIBRARY, JOB_DESCRIPTION, LIBRARY_LIST FROM QSYS2.JOB_DESCRIPTION_INFO WHERE LIBRARY_LIST LIKE '%APPLIB1%';
- Examine the library lists for every job description.Since the library list column returns a character string containing a list of libraries, to see the individual library names it needs to be broken apart. To do this, you can create a table function that takes the library list string and returns a list of library names.
Now this function can be used to return the list of library names.CREATE OR REPLACE FUNCTION QGPL.GET_LIB_NAMES(JOBD_LIBL VARCHAR(2750), JOBD_LIBL_CNT INT) RETURNS TABLE(LIBL_POSITION INT, LIBRARY_NAME VARCHAR(10)) BEGIN DECLARE IN_POS INT; DECLARE LIB_CNT INT; SET IN_POS = 1; SET LIB_CNT = 1; WHILE LIB_CNT <= JOBD_LIBL_CNT DO PIPE (LIB_CNT, RTRIM((SUBSTR(JOBD_LIBL, IN_POS, 10)))); SET IN_POS = IN_POS + 11; SET LIB_CNT = LIB_CNT + 1; END WHILE; RETURN; END;
SELECT JOB_DESCRIPTION, JOB_DESCRIPTION_LIBRARY, LIBL_POSITION, LIBRARY_NAME FROM QSYS2.JOB_DESCRIPTION_INFO, TABLE (QGPL.GET_LIB_NAMES(LIBRARY_LIST, LIBRARY_LIST_COUNT)) X;