ADMIN_TASK_LIST table function

The ADMIN_TASK_LIST function returns a table with one row for each of the tasks that are defined in the administrative task scheduler task list.

Authorization

The user who calls this function must have MONITOR1 privilege.

Read syntax diagramSkip visual syntax diagramADMIN_TASK_LIST()

The schema is DSNADM.

The result of the function is a table with the format shown in the following table. All the columns are nullable except TASK_NAME.
Table 1. Format of the resulting table for ADMIN_TASK_LIST
Column name Data type Contains
BEGIN_
TIMESTAMP
TIMESTAMP Contains the timestamp of when the task can first run. When the task begins to run depends on what values this and other columns contain:
  • If BEGIN_TIMESTAMP contains a non-null value:
    • If POINT_IN_TIME and TRIGGER_TASK_NAME contain null values, the task begins to run at the timestamp in BEGIN_TIMESTAMP
    • If POINT_IN_TIME contains a non-null value, the task begins to run at the next point in time that is defined at or after the timestamp in BEGIN_TIMESTAMP
    • If TRIGGER_TASK_NAME is a non-null value, the task begins to run at the next time that the task identified in TRIGGER_TASK_NAME completes or after the timestamp in BEGIN_ TIMESTAMP
  • If BEGIN_TIMESTAMP contains a null value:
    • If POINT_IN_TIME and TRIGGER_TASK_NAME contain null values, the task begins to run immediately
    • If POINT_IN_TIME contains a non-null value, the task begins to run at the next point in time that is defined
    • If TRIGGER_TASK_NAME is a non-null value, the task begins to run at the next time that the task identified in TRIGGER_TASK_NAME completes
END_
TIMESTAMP
TIMESTAMP Contains the timestamp of when the task is last able to run. If this column is NULL, there are no restrictions as to when the task must not run.
MAX_
INVOCATIONS
INTEGER Contains the maximum number of times the task can run. The maximum number applies to all types of schedules: triggered by events, scheduled by time interval, or by point in time. If this column is null, the task has no limit on the number of times it can be run.

If both END_TIMESTAMP and MAX_INVOCATIONS contain values, the value in END_TIMESTAMP takes precedence over the value for MAX_INVOCATIONS. That is, if the value in END_TIMESTAMP is reached, even though the number of times the task has run has not reached the value for MAX_INVOCATIONS, the task will not run again

INTERVAL INTEGER Contains an integer that indicates the duration between the start of one instance of a task and the start of the next instance of the same task. If the value of this column is NULL, the task is not scheduled to run at a regular interval.
POINT_IN_
TIME
VARCHAR(400) Contains one or more points in time (in UNIX cron format) for which the task is scheduled to run. If the value of this column is NULL, the task is not scheduled to run at a specific point in time.

The format contains the following pieces of information separated by blanks: given hour, given minute, given day of the week, given day of the month, given month of the year.

TRIGGER_
TASK_NAME
VARCHAR(128) Contains the task name of the task that, when its execution is complete, will trigger the running of the task that is described in the row.

Task name DB2STOP is reserved for Db2 stop events and task name DB2START is reserved for Db2 start events. Those events are handled by the administrative task scheduler that is associated with the Db2 subsystem that is starting or stopping.

If the value of this column is NULL, the task that is described in this row will not be triggered to run by another task.

TRIGGER_
TASK_COND
CHAR(2) Contains the type of comparison that is to be made to the return code after the running of task that is indicated in TRIGGER_TASK_NAME. The following values are possible:
GT
Greater than
GE
Greater than or equal to
EQ
Equal to
LT
Less than
LE
Less tan or equal to
NE
Not equal to

If this column contains NULL, the task is triggered to run without consideration of the return code of the task that is indicated in TRIGGER_TASK_NAME.

TRIGGER_
TASK_CODE
INTEGER Contains the return code from running the task indicated in TRIGGER_TASK_NAME.

If the running of this task is triggered by a stored procedure, TRIGGER_TASK_CODE contains the SQLCODE that must be returned by the stored procedure in order for this task to run.

If the running of this task is triggered by a JCL job, TRIGGER_TASK_CODE contains the MAXRC that must be returned by the job in order for this task to run.

ADMIN_TASK_STATUS table function returns the SQLCODE or MAXRC value in the SQLCODE or MAXRC column.

If TRIGGER_TASK_COND is NULL, this column will also be NULL.

DB2_SSID VARCHAR(4) Contains the Db2 subsystem ID of the Db2 subsystem that is associated with the administrative task scheduler that should run this task.

The value in this column is used in a data sharing environment where, for example different Db2 members have different configurations and running the task relies on a certain environment. A value in DB2_SSID will prevent an administrative scheduler of other members to run this task, so that the task can only be run as long as the administrative task scheduler of the subsystem indicated in DB2_SSID is running.

For a task that is being triggered by a Db2 start or Db2 stop event as indicated in the TRIGGER_TASK_NAME column, a value in DB2_SSID will allow the task to be run only when the indicated subsystem is starting or stopping. If no value is indicated in DB2_SSID, each subsystem that starts or stops will trigger a the task to be run locally, provided that the triggered task is run serially.

If this column is NULL, any administrative scheduler can run this task.

PROCEDURE_
SCHEMA
VARCHAR(128) Contains the schema of the Db2 stored procedure that this task will run. If the value of this column is null, Db2 uses a default schema.
PROCEDURE_
NAME
VARCHAR(128) Contains the name of the Db2 stored procedure that this task will run. If the value of this column is NULL, no stored procedure will be called when this task is run.
PROCEDURE_
INPUT
VARCHAR(4096) Contains a statement that returns one row of data. The returned value will be used as the input parameter of the stored procedure that this task will run. If this column contains the null value, no parameters are passed to the stored procedure when this task is run.
JCL_LIBRARY VARCHAR(44) Contains the name of the data set that contains the JCL job that is run when this task is run. If the value of this column is the null value, no JCL job will be run when this task is run.
JCL_MEMBER VARCHAR(8) Contains the name of the library member that contains the JCL job that is run when this task is run. If the value of this column is the null value, the data set that is specified in JCL_LIBRARY is sequential and contains the JCL job that is run when this task is run.
JOB_WAIT VARCHAR(8) Contains one of the following values, which indicates whether the JCL job can be run synchronously. If the value in the column is not null, this column contains one of the following values:
NO
Runs asynchronously
YES
Runs synchronously
PURGE
Runs synchronously and then the job status in z/OS® is purged
TASK_NAME VARCHAR(128) Contains the unique name that is assigned to this task.
DESCRIPTION VARCHAR(128) Contains a description of the task if one exists.
USERID VARCHAR(128) Contains the authorization ID of the user under which the task will be invoked. If this column is NULL, the task is invoked by the default authorization ID that is associated with the administrative task scheduler.
CREATOR VARCHAR(128) Contains the authorization ID that added the task to the administrative task scheduler task list.
LAST_MODIFIED TIMESTAMP Timestamp of when the task was added or last modified.
Example 1: Retrieve information about all of the tasks that are defined in the administrative task scheduler task list:
   SELECT *
     FROM TABLE (DSNADM.ADMIN_TASK_LIST()) AS T;