Start of change

TRACKED_JOB_INFO table function

The TRACKED_JOB_INFO table function returns information about the requested jobs. The information can be used to resubmit the job. Some information can be provided on the SBMJOB CL command. Other information can be provided on the CHGJOB CL command.

Authorization: The caller must have *JOBCTL special authority.

Read syntax diagramSkip visual syntax diagramTRACKED_JOB_INFO(NODE_NAME_FILTER => node-name-filter,IASP_NAME_FILTER => iasp-name-filter,JOB_QUEUE_LIBRARY_FILTER => job-queue-library-filter,JOB_QUEUE_FILTER => job-queue-filter)
The schema is QSYS2.
node-name-filter
A string containing a node name in the job tracking files to be included in the result. If this parameter is omitted, information for all nodes is eligible to be returned.
iasp-name-filter
A string containing a job queue independent ASP name in the job tracking files to be included in the result. Can contain the special value *SYSBAS. If this parameter is omitted, information for all ASPs is eligible to be returned.
job-queue-library-filter
A string containing a job queue library name in the job tracking files to be included in the result. If this parameter is omitted, information for all tracked job queue libraries is eligible to be returned.
job-queue-filter
A string containing a job queue name in the job tracking files to be included in the result. If this parameter is omitted, information for all tracked job queue queues is eligible to be returned.

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

Table 1. TRACKED_JOB_INFO table function
Column Name Data Type Description
NODE_NAME VARCHAR(8) The name of the IBM® i partition where the tracked job queue is located.
QUALIFIED_JOB_NAME VARCHAR(28) The qualified job name.
JOB_NAME VARCHAR(10) The name of the job.
JOB_USER VARCHAR(10) The user profile for the job.
JOB_NUMBER VARCHAR(6) The number of the job.
COMMAND_OR_REQUEST_DATA VARCHAR(20000) The command the job will run or the request data that is placed as an entry in the job's message queue.

Contains the null value if no command or request data for the job has been set.

JOB_ENTERED_SYSTEM_TIME TIMESTAMP(0) The timestamp for when the job was placed on the system.
JOB_ACTIVE_TIME TIMESTAMP(0) The timestamp for when the job started.

Contains the null value if the job has not started.

JOB_END_TIME TIMESTAMP(0) The timestamp for when the job ended.

Contains the null value if the job has not ended.

JOB_QUEUE_ASP_NAME VARCHAR(10) The ASP device name where the job queue is located.
JOB_QUEUE_LIBRARY VARCHAR(10) The name of the library containing the job queue.
JOB_QUEUE VARCHAR(10) The name of the job queue for the submitted job.
JOB_DESCRIPTION_LIBRARY VARCHAR(10) The name of the library containing the job description.
JOB_DESCRIPTION VARCHAR(10) The name of the job description used for this job.
JOB_END_SEVERITY INTEGER The return code of the job when it ended.

Contains the null value if the job has not ended.

PROCESSING_UNIT_TIME BIGINT The amount of processing unit time used by the job, in milliseconds.

Contains the null value if the job has not ended.

JOB_QUEUE_PRIORITY 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.
PRINTER_DEVICE_NAME VARCHAR(10) The printer device used for printing output from this job.
OUTPUT_QUEUE_LIBRARY VARCHAR(10) The name of the library that contains the default output queue.

Contains the null value if OUTPUT_QUEUE contains a special value.

OUTPUT_QUEUE VARCHAR(10) The name of the default output queue that is used for spooled output produced by this job. The default output queue is only for spooled printer files that specify *JOB for the output queue. Can contain the special value *DEV.
OUTPUT_QUEUE_PRIORITY INTEGER The output priority for spooled output files that this job produces. The highest priority is 0, and the lowest is 9.
JOB_ACCOUNTING_CODE VARCHAR(15) An identifier assigned to the job by the system to collect resource use information for the job when job accounting is active.
RUN_PRIORITY INTEGER The priority at which the job or thread competes for the processing unit relative to other jobs and threads that are active at the same time. The run priority ranges from 1 (highest priority) to 99 (lowest priority).

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

PRINT_TEXT VARCHAR(30) The line of text that is printed at the bottom of each page of printed output for the job.
ROUTING_DATA VARCHAR(80) The routing data that is used to determine the routing entry that identifies the program to start for the routing step. Can contain the following special value:
*RQSDTA
The first 80 characters of COMMAND_OR_REQUEST_DATA are used as the routing data for the job.
CURRENT_LIBRARY VARCHAR(10) The current library. Can contain the following special value:
*CRTDFT
There is no current library for the submitted job. If objects are created in the current library, QGPL is used as the default current library.
SYSTEM_LIBRARY_LIST_COUNT INTEGER The number of libraries in the system portion of the library list.
SYSTEM_LIBRARY_LIST VARCHAR(165) The system portion of the library list. The list is an array of 11 character entries. Each entry contains a ten character name followed by one blank.

Contains the null value if the system library list specified when the job was submitted was empty.

USER_LIBRARY_LIST_COUNT INTEGER The number of libraries in the user portion of the library list.
USER_LIBRARY_LIST VARCHAR(2750) The user portion of the library list. The list is an array of 11 character entries. Each entry contains a ten character name followed by one blank.

Contains the null value if no user library list was specified when the job was submitted, or the specified library list was empty.

INITIAL_JOB_ASP_GROUP VARCHAR(10) The initial setting for the auxiliary storage pool (ASP) group name for the initial thread of the submitted job. Can contain the following special value:
*NONE
The initial thread of the submitted job will be started with no ASP group.
MESSAGE_LOGGING_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 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 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 VARCHAR(4) Specifies whether or not commands are logged for CL programs that are run.
*NO
Commands are not logged.
*YES
Commands are logged.
JOB_LOG_OUTPUT 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.
MAXIMUM_JOB_MESSAGE_QUEUE_SIZE INTEGER The maximum size, in megabytes, that the job message queue can become. The range is 2 to 64.
JOB_MESSAGE_QUEUE_FULL_ACTION 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.
INQUIRY_MESSAGE_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.
HOLD_ON_JOB_QUEUE VARCHAR(4) Whether this job is on the job queue with a status of held.
*NO
It was not added to the job queue with a status of held.
*YES
It was added to the job queue with a status of held.
BREAK_MESSAGE VARCHAR(10) 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.

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

STATUS_MESSAGE VARCHAR(10) Specifies whether status messages are displayed for this job.
*NONE
This job does not display status messages.
*NORMAL
This job displays status messages.

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

DDM_CONVERSATION 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.

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

JOB_SCHEDULED_TIME TIMESTAMP(0) The timestamp for when the job is scheduled to become active.

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

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.

Contains the null value if no date has been assigned to the job.

DATE_FORMAT 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.

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

DATE_SEPARATOR CHAR(1) The date separator used for this job.

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

TIME_SEPARATOR CHAR(1) The time separator used for this job.

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

JOB_SWITCHES CHAR(8) The current setting of the job switches used by this job.
ALLOW_WRKSBMJOB VARCHAR(4) Specifies whether the job being submitted is allowed to be shown on the Work with Submitted Jobs panel.
*NO
This job is not shown on any display produced by the WRKSBMJOB command.
*YES
This job can be shown by the WRKSBMJOB command.
QUALIFIED_SUBMITTER_JOB_NAME VARCHAR(28) The qualified job name of the submitter's job.
SUBMITTER_JOB_NAME VARCHAR(10) The job name of the submitter's job.
SUBMITTER_JOB_USER VARCHAR(10) The user name of the submitter's job.
SUBMITTER_JOB_NUMBER VARCHAR(6) The number of the submitter's job.
JOBEND_MESSAGE_QUEUE_LIBRARY VARCHAR(10) The name of the library containing JOBEND_MESSAGE_QUEUE.

Contains the null value if JOBEND_MESSAGE_QUEUE contains a special value.

JOBEND_MESSAGE_QUEUE VARCHAR(10) The message queue where the completion message is sent when the submitted job has completed running. Can contain the following special value:
*NONE
No completion message is sent.
TIME_SLICE INTEGER 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 time slice value for the job has not been set.

PURGE_ALLOWED VARCHAR(4) Specifies whether the job is eligible to be moved out of main storage and put into auxiliary storage at the end of a time slice or when entering a long wait (such as waiting for a work station user's response).
*NO
The job is not eligible to be moved out of main storage and put into auxiliary storage.
*YES
The job is eligible to be moved out of main storage and put into auxiliary storage.

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

DEFAULT_WAIT INTEGER 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 a default wait time for the job has not been set.

PRINT_KEY_FORMAT VARCHAR(10) 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.

Contains the null value if the print key format for the job has not been set.

SORT_SEQUENCE_LIBRARY VARCHAR(10) The name or the library that contains the sort sequence table.

Contains the null value when SORT_SEQUENCE is a special value.

SORT_SEQUENCE VARCHAR(10) The name of the sort sequence table associated with this job. Can contain the following special values:
*HEX
No sort sequence is used.
*LANGIDSHR
The shared sort sequence for the language identifier is used.
*LANGIDUNQ
The unique sort sequence for the language identifier is used.
LANGUAGE_ID CHAR(3) The language identifier associated with this job.
COUNTRY_ID CHAR(2) The country or region identifier associated with this job.
CCSID INTEGER The coded character set identifier (CCSID) used for this job.
COPY_ENVIRONMENT_VARIABLES VARCHAR(4) Specifies whether the environment variables from the submitting job are copied to the new job.
*NO
The environment variables are not copied.
*YES
The environment variables are copied.
ALLOW_MULTIPLE_THREADS VARCHAR(4) 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.
DECIMAL_FORMAT 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.

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

CHARACTER_IDENTIFIER_CONTROL 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.

Contains the null value if the character identifier control for the job has not been set.

SPOOLED_FILE_ACTION 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.
MAXIMUM_PROCESSING_TIME_ALLOWED INTEGER 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 the maximum processing unit time for the job has not been set.

MAXIMUM_TEMPORARY_STORAGE_ALLOWED INTEGER 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 the maximum auxiliary storage for the job has not been set.

PROCESSOR_RESOURCES_PRIORITY VARCHAR(10) If simultaneous multithreading (SMT) is enabled for the system, the relative importance of the job when it is dispatched compared to other jobs that are dispatched.
*HIGH
The operating system will isolate this job and its threads, when possible, to processors with fewer threads running concurrently.
*LOW
The job and its threads will be dispatched to processors with other low priority jobs executing, when possible.
*NORMAL
The job and its threads will be dispatched uniformly across the maximum number of available processors.
*SYSCTL
The system determines the processor resources priority for the job and its threads.

Contains the null value if the processor resources priority for the job has not been set.

ROUTING_STEP INTEGER A unique number. When TFRJOB is performed for a tracked job, a higher number is generated for a new job record.
INTERNAL_JOB_IDENTIFIER BINARY(16) The internal job identifier.

Example

  • Show all entries in the job queues tracking table for jobs that have not completed for job queue MYJOBQ in library JQLIB.
    SELECT * FROM TABLE(QSYS2.TRACKED_JOB_INFO(JOB_QUEUE_LIBRARY_FILTER => 'JQLIB',
                                               JOB_QUEUE_FILTER => 'MYJOBQ'))
      WHERE JOB_END_TIME IS NULL;
End of change