Start of change

PRESTART_JOB_STATISTICS table function

The PRESTART_JOB_STATISTICS table function returns statistics and performance information for an active prestart job entry in an active subsystem. The information is collected from the time the reset key is pressed on the Display Active Prestart Jobs (DSPACTPJ) command, from the time the prestart job entry is started, or from the time RESET_STATISTICS => 'YES' is run for this table function. The prestart job entry is started when the subsystem starts or when the Start Prestart Jobs (STRPJ) command is used.

This information is similar to what is returned by the Display Active Prestart Jobs (DSPACTPJ) command and the Retrieve Active Prestart Jobs Status (QWTRAPJS) API.

Authorization: The caller must have:
  • *EXECUTE authority to the prestart job's program library.
  • *USE authority to the ASP device description, if the subsystem description specifies an ASP group name.
.
Read syntax diagramSkip visual syntax diagramPRESTART_JOB_STATISTICS( SUBSYSTEM_NAME =>  subsystem-name ,PRESTART_JOB_PROGRAM_LIBRARY =>  prestart-job-program-library ,PRESTART_JOB_PROGRAM =>  prestart-job-program,RESET_STATISTICS => reset-statistics,IGNORE_ERRORS => ignore-errors)
The schema is QSYS2.
subsystem-name
A character or graphic string expression that contains the name of the active subsystem that contains the prestart job entry.
prestart-job-program-library
A character or graphic string expression that contains the name of the library where prestart-job-program is located. Can contain the following special values:
*CURLIB
The thread's current library is used to locate prestart-job-program.
*LIBL
The library list is used to locate prestart-job-program.
prestart-job-program
A character or graphic string expression that contains the name of the program that identifies the active prestart job entry.
reset-statistics
A character or graphic string expression that contains a value of YES or NO to indicate whether the statistical information should be reset. If this parameter is not specified, the default is NO.

If the value is YES, the statistics are reset after the information is gathered. The reset applies to the statistics shown by the Display Active Prestart Jobs (DSPACTPJ) command as well.

ignore-errors

A character or graphic string expression that identifies what to do when an error is encountered.

NO

An error is returned.

YES
A warning is returned.
No row is returned when an error is encountered. This is the default.

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

Table 1. PRESTART_JOB_STATISTICS view
Column Name Data Type Description
SUBSYSTEM_NAME VARCHAR(10) The name of the active subsystem that contains the prestart job entry.
PRESTART_JOB_PROGRAM_LIBRARY VARCHAR(10) The library where the prestart job program is located.
PRESTART_JOB_PROGRAM VARCHAR(10) The program that identifies the active prestart job entry.
STATUS_TIMESTAMP TIMESTAMP The date and time this active prestart jobs status information was collected.
ELAPSED_TIME INTEGER The time that has elapsed, in seconds, since the last reset date/time.

The value will not reflect elapsed time beyond 10,000 hours. A value of 0 might mean that the elapsed time could not be calculated.

CURRENT_JOBS INTEGER The current number of active jobs associated with the prestart job entry.
AVERAGE_JOBS DECIMAL(10,1) The average number of jobs that have been active since the reset date/time. This value is based on calculations involving time intervals and is inaccurate if the system clock was changed while information is being collected.

This value will be recalculated after statistics are reset.

PEAK_JOBS INTEGER The maximum number of jobs that have been active since the reset date/time.

This value will be recalculated after statistics are reset.

CURRENT_INUSE_JOBS INTEGER The current number of jobs in use.
AVERAGE_INUSE_JOBS DECIMAL(10,1) The average number of jobs in use since the reset date/time. This value is based on calculations involving time intervals and is inaccurate if the system clock was changed while information is being collected.

This value will be recalculated after statistics are reset.

PEAK_INUSE_JOBS INTEGER The maximum number of jobs in use since the reset date/time.

This value will be recalculated after statistics are reset.

CURRENT_WAIT_REQUESTS INTEGER The number of requests that are waiting for a prestart job.
AVERAGE_WAIT_REQUESTS DECIMAL(10,1) The average number of requests that have waited for a prestart job since the reset date/time. This value is based on calculations involving time intervals and is inaccurate if the system clock was changed while information is being collected.

This value will be recalculated after statistics are reset.

PEAK_WAIT_REQUESTS INTEGER The maximum number of requests that have waited at one time for an available prestart job since the reset date/time.

This value will be recalculated after statistics are reset.

AVERAGE_WAIT_TIME DECIMAL(10,1) The average time, in seconds, that requests have waited to be attached to a prestart job since the reset date/time. This includes requests that wait and requests that do not wait. This value is based on calculations involving time intervals and is inaccurate if the system clock was changed while information is being collected.

This value will be recalculated after statistics are reset.

ACCEPTED_REQUESTS INTEGER The total number of accepted requests since the reset date/time. An accepted request is one that is either attached immediately to a prestart job, or is queued because a prestart job is not available.

This value will be recalculated after statistics are reset.

REJECTED_REQUESTS INTEGER The total number of rejected requests since the reset date/time. A request is rejected if
  • *NO is specified for the WAIT parameter on the prestart job entry and there are no jobs currently available to handle the request.
  • *YES is specified for the WAIT parameter and there are more program start requests than the maximum jobs allowed.

This value will be recalculated after statistics are reset.

Example

List the current statistics for all prestart jobs in the QUSRWRK subsystem. A warning will be issued for each prestart job returned from PRESTART_JOB_INFO that is not active.

SELECT PJ.PRESTART_JOB_NAME, STAT.* 
  FROM QSYS2.PRESTART_JOB_INFO PJ,
    LATERAL (
       SELECT * FROM TABLE 
            (QSYS2.PRESTART_JOB_STATISTICS(PJ.SUBSYSTEM_DESCRIPTION, 
                                           PJ.PRESTART_JOB_PROGRAM_LIBRARY, 
                                           PJ.PRESTART_JOB_PROGRAM))) AS STAT
  WHERE PJ.SUBSYSTEM_ACTIVE = 'YES' AND
        PJ.SUBSYSTEM_DESCRIPTION = 'QUSRWRK';
End of change