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.

Authorization: The caller must have:
  • *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.

Table 1. JOB_DESCRIPTION_INFO view
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:
*RQD
A user name is required to use the job description.
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:
*USRPRF
The accounting code used for jobs using this job description is obtained from the job's user profile.
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:
QCMDI
The default routing data QCMDI is used by the IBM®-supplied interactive subsystem to route the job to the IBM-supplied control language processor QCMD in the QSYS library.
*RQSDTA
Up to the first 80 characters of the request data specified in the request data field are used as the routing data for the job.
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:
*RTGDTA
The data specified in the routing data parameter is placed as the last entry in the job's message queue.

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:
*SYSVAL
The jobs using this job description will use the library list specified by the QUSRLIBL system 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.
*NO
Jobs using this job description are not put on the job queue as held.
*YES
Jobs using this job description are put on the job queue as 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:
*DEV
The output queue with the same name as the printer device for this job description is used.
*USRPRF
The output queue name for jobs using this job description is obtained from the user profile of the job at the time the job is started.
*WRKSTN
The output queue name is obtained from the device description from which this job is started.
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.
*DETACH
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.
*SYSVAL
The jobs using this job description will take the spooled file action specified by the QSPLFACN system value.
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:
*SYSVAL
The value in the system value QPRTDEV at the time the job is started is used as the printer device name.
*USRPRF
The printer device name is obtained from the user profile of the job at the time the job is started.
*WRKSTN
The printer device name is obtained from the work station where the job was started.
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:
*SYSVAL
The value in the system value QPRTTXT is used for jobs using this job description.

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.
*NOWRAP
When the message queue becomes full, do not wrap. This action will cause the job to end.
*PRTWRAP
When the message queue becomes full, wrap the job queue and print the messages that are being overlaid.
*SYSVAL
The value is specified by the system value QJOBMSGQFL.
*WRAP
When the message queue becomes full, wrap to the beginning and start filling again.
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:
0-99
Specifies the lowest message severity that causes a running job to end. The request data is checked for syntax as CL commands, and, if a syntax error occurs that is greater than or equal to the error message severity specified here, the running of the job that contains the erroneous command is suppressed.

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:
*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.
*SYSVAL
The value is specified by the QLOGOUTPUT system value.
INQUIRY_MESSAGE_REPLY INQ_REPLY VARCHAR(8) How inquiry messages are answered for jobs that use this job description.
*DFT
The system uses the default message reply to answer any inquiry messages issued while the job is running. The default reply is either defined in the message description or is the default system reply.
*RQD
The job requires an answer for any inquiry messages that occur while the job is running.
*SYSRPYL
The system reply list is checked to see if there is an entry for an inquiry message issued while the 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.
MESSAGE_LOGGING_LEVEL LOG_LEVEL SMALLINT The type of information 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 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.
*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 (if 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) Whether or not commands are logged for CL programs that are run.
*NO
CL programs are not logged.
*YES
CL programs are logged.
DEVICE_RECOVERY_ACTION DEVRECOVER VARCHAR(13) The action to take when an I/O error occurs for the interactive job's requesting program device.
*DSCENDRQS
Disconnects the job when an I/O error occurs. When the job reconnects, the system sends the End Request (ENDRQS) command to return control to the previous request level.
*DSCMSG
Disconnects the job when an I/O error occurs. When the job reconnects, the system sends a message to the application program indicating the job has reconnected and that the workstation device has recovered.
*ENDJOB
Ends the job when an I/O error occurs. A message is sent to the job's log and to the history log (QHST). This message indicates that the job ended because of a device error.
*ENDJOBNOLIST
Ends the job when an I/O error occurs. There is no job log produced for the job. The system sends a message to the history log (QHST). This message indicates that the job ended because of a device error.
*MSG
Signals the I/O error message to the application and lets the application program perform error recovery.
*SYSVAL
The value in the system value QDEVRCYACN at the time the job is started is used as the device recovery action for this job description.
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.
*BASE
The job is moved to the base pool when it reaches time-slice end.
*NONE
The job is not moved when it reaches time-slice end.
*SYSVAL
The system value is used.
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.
*NO
The job is not allowed to run with multiple user threads.
*YES
The job is allowed to run with 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:
*SBSD
The workload group named in the subsystem description is used.

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:
*DROP
The system ends a DDM-allocated conversation when there are no users.
*KEEP
The system keeps DDM conversation connections active when there are no users.

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.
    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;   
    Now this function can be used to return the list of library names.
    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;