GET_STATISTIC_DETAIL

Use the GET_STATISTIC_DETAIL script function to retrieve a detail from the execution data of an object. Execution lists store a broad range of data on executed objects. For more information, see Execution Data.

Note: You need authorization (S) to access the execution data of the given object to execute this script function. For more information, see Granting Automation Engine Authorizations.

Syntax

GET_STATISTIC_DETAIL ([RunID], Detail [, Object name])

Parameters

Parameter Description Format
RunID (Optional) RunID of the execution. Script variable or number
Detail Information to retrieve from the execution data. AE name, script literal, or script variable
Object name (Optional) Name of the object for which to retrieve execution data. Script literal or script variable

Important Considerations

Keep the following rules and behaviors in mind when using this script function:

  • The following default values are returned when the specified detail is not available at the time of the script execution:

    • For strings: an empty string

    • For numbers: 0

    • For date and time stamps: 0000-00-00 00:00:00

  • What looks like a default value may be the actual value that is retrieved from the execution data, such as a return code of 0.

  • The script function returns numbers in a 16-digit format by default, including floating-point numbers (data type: float). Zeros are inserted in places that are not used. For more information, see Script Variable Data Types.

    Tip: Use the FORMAT script function to remove leading or final zeros.

  • The script does not abort when no execution data is found and the script function returns an empty string.

    Tip: Use the :ON_ERROR script statement to define actions to take.

Return Codes

GET_STATISTIC_DETAIL returns a detail from the list of execution data depending on the parameters that you specify:

  • RunID and Detail (and optionally the Object name): returns the detail from the specified run of a particular object
  • Detail and Object name: returns the detail from the latest run of the specified object
  • Detail only: returns the detail from the current execution data for the object that calls the script function
    Note: The script cannot return values for certain details such as the runtime for the current execution, because the object is being executed.

All Object Types

The following details from the execution data are available for all types of executable objects.

General Details

Return Value Description
ACCOUNT Internal account
ARCHIVE_KEY_1 Archive key 1
ARCHIVE_KEY_2 Archive key 2
ALIAS Alias of the executable object
NAME Name of the object
OBJECT_TYPE Type of the object
USER_ID Name of the user (NAME/DEPARTMENT)
USER_TIME User time used

Activation and Execution Details

Return Value Description Specific Return Codes
ACTIVATION_TIME Time of the activation in YYYY-MM-DD HH:MM:SS format n.a.
CANCEL_FLAG Indicates whether the task was canceled
  • An empty string
    The task was not canceled
  • M
    The task was canceled
DURATION Runtime in seconds n.a.
END_TIME End time of the object in YYYY-MM-DD HH:MM:SS format n.a.
LAST_ERR_INS Error message of the last error that occurred n.a.
LAST_ERR_NR Error number of the last error that occurred n.a.
LDATE Logical date in YYYY-MM-DD HH:MM:SS format n.a.
MOD_COUNT Number of modifications to the object n.a.
POSTSCRIPT_START_TIME Start time of the Post Process in YYYY-MM-DD HH:MM:SS format n.a.
RETURN_CODE Return code n.a.
RUNID RunID of the selected execution data n.a.
START_TIME Start time of the object in YYYY-MM-DD HH:MM:SS format n.a.
STATUS Status of the execution. For more information on system return codes, see System Return Codes of Executable Objects. n.a.

Restarts

Return Value Description Specific Return Codes
LAST_RESTART_POINT Last passed restart point n.a.
REFERENCE_NR Reference RunID in a restart n.a.
RESTART Indicates whether the execution is a restart
  • Y
    The execution is a restart
  • N
    The execution is not a restart
RESTART_POINT Restart point for the task n.a.

Information about Parent Tasks and Activators

Return Value Description
PARENT_ACT RunID of the activator of the task. More information: Superordinate Tasks (Parents)
PARENT_PRC RunID of the parent task when the parent is a processor (Workflow, Schedule or Group)
PROCESS_ID TSN/Process ID

Event Objects

The following details from the execution data are available for Event objects only.

Return Value Description
CHECK_COUNT (Event objects only) Number of checks made
EVENTID First RunID of File System and Console events
OCCURRENCE_COUNT Number of events that have occurred

File Transfer Objects

The following details from the execution data are available for File Transfer objects only.

Return Value Description Specific Return Codes
COMPRESSION_RATE Compression level
  • 0
    None
  • 1
    Normal
  • 2
    Strong
  • An empty string
    Default value
DST_CODE_TABLE Name of the destination code table n.a.
DST_FILE_ATTRIBUTES File attributes for the destination file n.a.
DST_FILE_NAME Name of the destination file n.a.
DST_HOST Name of the destination agent n.a.
DST_HOST_TYPE Host type of the destination agent
  • BS2000
  • MVS
  • NSK
  • OS400
  • UNIX
  • VMS
  • WINDOWS
DST_LOGIN_INFO Complete login information of the destination Login object of the File Transfer n.a.
DST_LOGIN_NAME Name of the destination Login object n.a.
FILE_SIZE Number of bytes used by the transferred file n.a.
RECORDS (Text file transfers only) Number of transferred lines or records.
Note: If the transferred file is a binary file, the return code is 0.
n.a.
SRC_CODE_TABLE Name of the source code table n.a.
SRC_FILE_ATTRIBUTES File attributes of the source file n.a.
SRC_FILE_NAME Name of the source file n.a.
SRC_HOST Name of the source agent n.a.
SRC_HOST_TYPE Host type of the source agent
  • BS2000
  • MVS
  • NSK
  • OS400
  • UNIX
  • VMS
  • WINDOWS
SRC_LOGIN_INFO Complete login information of the source Login object of the File Transfer n.a.
SRC_LOGIN_NAME Name of the source Login object n.a.
TRANSFERRED_BYTE_COUNT Number of transferred bytes n.a.

Job Objects

The following details relate to the consumed resources for the run, and are available for Job objects only.

Return Value Description
CPU_TIME The CPU time used
IO_COUNT Number of I/Os
KERNEL_TIME Kernel time used

Examples

The following script, executed within a File Transfer object, actively reads the name of the file to transfer by querying the current execution data:

: SET &SOURCE_FILE# = GET_STATISTIC_DETAIL (,SRC_FILE_NAME)

The following example reads the exact start time of the parent task:

: SET &NAME# = SYS_ACT_PARENT_NAME ()

 : SET &START# = GET_STATISTIC_DETAIL (,START_TIME, &NAME#)

The following script queries and retrieves the activation time of an object named MM.DAY:

: SET &RUNNR# = GET_UC_OBJECT_NR ("MM.DAY" )

 : SET &ACTIVATION# = GET_STATISTIC_DETAIL (&RUNNR# , ACTIVATION_TIME)

The following example fetches and subsequently prints the alias of the executable object directly into the activation report:

: SET &ALIAS# = GET_STATISTIC_DETAIL (&RUNID#,ALIAS)

: PRINT &ALIAS#

See also: