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

  • GET_STATISTIC_DETAIL
    Retrieves execution data of an object

  • RunID
    (Optional) RunID of the execution
    Format: script variable or number

  • Detail
    Information to retrieve from the execution data
    Format: AE name, script literal, or script variable

  • Object name
    (Optional) Name of the object for which to retrieve execution data
    Format: script literal or script variable

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.

Important! 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

Notes:

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

All Object Types

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

General Details

  • 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

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

Restarts

  • LAST_RESTART_POINT
    Last passed restart point
  • REFERENCE_NR
    Reference RunID in a restart
  • RESTART
    Indicates whether the execution is a restart
    Return codes:
    • Y
      The execution is a restart
    • N
      The execution is not a restart
  • RESTART_POINT
    Restart point for the task

Information about Parent Tasks and Activators

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

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

  • COMPRESSION_RATE
    Compression level
    Return codes:
    • 0
      None
    • 1
      Normal
    • 2
      Strong
    • An empty string
      Default value
  • DST_CODE_TABLE
    Name of the destination code table
  • DST_FILE_ATTRIBUTES
    File attributes for the destination file
  • DST_FILE_NAME
    Name of the destination file
  • DST_HOST
    Name of the destination agent
  • DST_HOST_TYPE
    Host type of the destination agent
    Return codes:
    • BS2000
    • MVS
    • NSK
    • OS400
    • UNIX
    • VMS
    • WINDOWS
  • DST_LOGIN_INFO
    Complete login information of the destination Login object of the File Transfer
  • DST_LOGIN_NAME
    Name of the destination Login object
  • FILE_SIZE
    Number of bytes used by the transferred file
  • 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.
  • SRC_CODE_TABLE
    Name of the source code table
  • SRC_FILE_ATTRIBUTES
    File attributes of the source file
  • SRC_FILE_NAME
    Name of the source file
  • SRC_HOST
    Name of the source agent
  • SRC_HOST_TYPE
    Host type of the source agent
    Return codes:
    • BS2000
    • MVS
    • NSK
    • OS400
    • UNIX
    • VMS
    • WINDOWS
  • SRC_LOGIN_INFO
    Complete login information of the source Login object of the File Transfer
  • SRC_LOGIN_NAME
    Name of the source Login object
  • TRANSFERRED_BYTE_COUNT
    Number of transferred bytes

Job Objects

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

  • CPU_TIME
    The CPU time used
  • IO_COUNT
    Number of I/Os
  • KERNEL_TIME
    Kernel time used

Examples

The following example in a File Transfer object reads the name of the file to transfer from the current execution data.

:SET &SOURCE_FILE# = GET_STATISTIC_DETAIL(,SRC_FILE_NAME)

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

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

The following example retrieves the activation time of an object that is called MM.DAY:

:SET &RUNNR# = GET_UC_OBJECT_NR("MM.DAY")
 :
SET &ACTIVATION# = GET_STATISTIC_DETAIL(&RUNNR#, ACTIVATION_TIME)

The following example reads and prints the alias of the executable object in the activation report.

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

:PRINT &ALIAS#

See also: