GET_CONSOLE, GET_EVENT_INFO

Use the GET_CONSOLE and the GET_EVENT_INFO script functions to retrieve information about CONS, FILE and DB events that have occurred. Both script functions have the same syntax.

Syntax

GET_CONSOLE (Keyword[, Index])
GET_EVENT_INFO (Keyword[, Index])

Parameters

  • GET_CONSOLE
    Retrieves message data when Console-type events occur.
    (BS2000 and z/OS) Retrieves the Console message
    (OS/400) Retrieves information from a message queue. You can define the message queue to be monitored in the INI file of the OS/400 agent. For more information, see CONS Events.
  • GET_EVENT_INFO
    Retrieves information from the scripts of FILE events where z/OS provides specific keywords.
  • Keyword
    Defines the message part that should be read. The keywords for the individual platforms are explained below.
    Format: Format: AE name, script literal or script variable
    • ACCESS
      Access to the file
      Available for: Automatic z/OS FILE events
      Allowed value:
      • CLOSE
        Closes the file
    • ACTIVATIONSTATE
      Retrieves the adapter status
      Available for: SAP XI
      Allowed values:
      • STARTED
      • STOPPED
    • ALERT_OPTION
      Retrieves if and when an SNA alert is created and sent to the message

      Available for: OS/400 and Windows
      Allowed values:
      • DEFER
        An alert is sent after local problem analysis
      • IMMED
        An alert is sent immediately when the message is sent. For the message queue, the attribute permitting alerts must be set to *YES
      • NO
        No alert is sent
      • UNATTEND
        An alert is only sent if the system runs in non-monitored mode. The alarm status network attribute (ALERTS) is *UNATTEND.
    • CATEGORY
      Retrieves the Event category
      Available for: Windows
    • CHANNEL
      Retrieves the communication channel
      Available for: SAP XI
    • DDNAME
      Retrieves the DD description
      Available for: Automatic z/OS FILE events
    • EVENT_ADDITIONAL_PARM
      Retrieves additional parameters of SAP Java Scheduler events
      Available for: SAP Java
    • EVENT_COUNTOFJOBS
      Retrieves the number of triggered SAP ABAP jobs
      Available for: SAP ABAP
    • EVENT_GUID
      Retrieves the instance number of SAP ABAP events
      Available for: SAP Java
    • EVENT_ID
      Retrieves the Event ID of ABAP and Java events
      Available for: SAP ABAP, SAP Java, and Windows
    • EVENT_PARM
      Retrieves SAP event parameters of ABAP and Java events
      Available for: SAP ABAP and SAP Java
    • EVENT_PROCESSSTATE
      Retrieves the SAP ABAP processing status
      Available for: SAP ABAP
    • EVENT_SERVER
      Retrieves the SAP ABAP event server
      Available for: SAP ABAP
    • EVENT_STATE
      Retrieves the SAP ABAP event status
      Available for: SAP ABAP
    • EVENT_TYPE
      Retrieves the SAP Java Scheduler event type
      Available for: SAP Java
    • FILENAME
      Retrieves the name of the file
      Available for: FILE events and Automatic z/OS FILE events
      (FILE events only) You must set the Check Conditions of FILE events to FILE_SIZE or empty, regardless if combined with FILE_STABLE or FILE_CHANGEd; and PATH_FILE_COUNT which must be combined with FILE_STABLE or FILE_CHANGED. For more information, see File Event Attributes.

      FILE events with wildcards return the following as file names:
      • *ALL
        If the All files must match option is selected
      • *ONE
        If the One file must match option is not selected
    • FILESIZE
      Retrieves the SIZE of the file
      Available for: FILE events
      (FILE events only) You must set the Check Conditions of FILE events to FILE_SIZE or empty, regardless if combined with FILE_STABLE or FILE_CHANGEd; and PATH_FILE_COUNT which must be combined with FILE_STABLE or FILE_CHANGED. For more information, see File Event Attributes.
       
    • ID
      Retrieves the message ID
      Available for: SAP XI
    • INFO_ACTION
      Retrieves the action
      Available for: Automatic z/OS FILE events
      Allowed values:
      • YES
        An object has been activated
      • NO
        No object has been activated
    • INFO_TEXT
      Retrieves the name of the activated object
      Available for: Automatic z/OS FILE events 
    • INSERT
      Retrieves a specific variable part of a message together with the Indexparameter
      Available for: OS 400 and Windows
    • INSERT_COUNT
      Determines the number of variable message parts to be retrieved
      Available for: OS 400 and Windows
    • INSERT_ID
      Retrieves the identification of the job
      Available for: Automatic z/OS FILE events and z/OS
    • INSERT_NAME
      Retrieves the identification of the job
      Available for: Automatic z/OS FILE events and z/OS
    • JOB_ABENDED
      Retrieves the end status of the job that closed the file
      Available for: Automatic z/OS FILE events
      Allowed values:
      • YES
        The job ended abnormally
      • NO
        The job ended normally
    • JOB_ENDED
      Retrieves the end status of the job that closed the file
      Available for: Automatic z/OS FILE events
      Allowed values:
      • YES
        The job has already ended
      • NO
        The job is still running
    • JOB_NAME
      Retrieves the name of the job
      Available for: Automatic z/OS FILE events and z/OS
    • LPAR_NAME
      Retrieves the LPAR name
      Available for: Automatic z/OS FILE events and z/OS
    • MEMGEN
      Retrieves the member name or the generation number
      Available for: Automatic z/OS FILE events
    • MSG_DESCRIPTOR
      Describes the message as a 16-bit field
      Available for: z/OS
      Values:
      • Bit 01(corresponds to  X'80')
        SYSTEM_FAILURE
      • Bit 02 (corresponds to X'40')
        IMMEDIATE_ACTION
        Immediate Action Required
      • Bit 03 (corresponds to X'20')
        EVENTUAL_ACTION
        Eventual Action Required
      • Bit 04 (corresponds to X'10')
        SYSTEM_STATUS
      • Bit 05 (corresponds to X'08')
        IMMEDIATE_COMMAND
        Immediate Command Response
      • Bit 06 (corresponds to X'04')
        JOB_STATUS
      • Bit 07 (corresponds to X'02')
        APPLICATION
        Application program/ processor
      • Bit 08 (corresponds to  X'01')
        OUT_OF_LINE
      • Bit 09 (corresponds to  X'80')
        OPERATOR_REQUEST
      • Bit 10 (corresponds to  X'40')
        TRACK_COMMAND_R
        Track command response
      • Bit 11 (corresponds to  X'20')
        CRITICAL_ACTION
        Critical eventual action
      • Bit 12 (corresponds to  X'10')
        IMPORTANT_INFO
      • Bit 13 (corresponds to  X'08')
        PREVIOUSLY_AUTO
        Previously automated
      • Bit 14 (corresponds to  X'04')
        Reserved
      • Bit 15 (corresponds to  X'02')
        Reserved
      • Bit 16 (corresponds to  X'01')
        R
        eserved
    • MSG_FILE_LIBRARY
      Name of the library that includes the message file, or the *CURLIB or *LIBL values that the sending program uses
      Available for: OS/400
    • MSG_FILE_NAME
      Name of the message file that includes the received message
      Available for: OS/400
    • MSG_ID
      Message ID of the received message. A blank is returned if the received message is an improvised message.
      Available for: OS/400
    • MSG_KEY
      Message key of the received message. The key is a four-digit value in hexadecimal format X'xxxxxxxx'
      Available for: OS/400
    • MSG_LEVEL
      Urgency level of the message (16-bit field)

      Available for: z/OS
      Values:
      • Bit 01(corresponds to  X'80')
        WTOR
      • Bit 02 (corresponds to X'40')
        IMMEDIATE_ACTION
      • Bit 03 (corresponds to X'20')
        CRITICAL_ACTION
        Critical eventual action
      • Bit 04 (corresponds to X'10')
        EVENTUAL_ACTION
        Eventual action required
      • Bit 05 (corresponds to X'08')
        INFO
        Informational
      • Bit 06 (corresponds to X'04')
        BROADCAST
      • Bit 07 (corresponds to X'02')
        Reserved
      • Bit 08 (corresponds to  X'01')
        Reserved
      • Bit 09 (corresponds to  X'80')
        Reserved
      • Bit 10 (corresponds to  X'40')
        Reserved
      • Bit 11 (corresponds to  X'20')
        Reserved
      • Bit 12 (corresponds to  X'10')
        Reserved
      • Bit 13 (corresponds to  X'08')
        Reserved
      • Bit 14 (corresponds to  X'04')
        Reserved
      • Bit 15 (corresponds to  X'02')
        Reserved
      • Bit 16 (corresponds to  X'01')
        Reserved
    • MSG_LIBRARY_USED
      Real name of the library that is used to send the message. The library can include instructions that override others. Therefore, the library can differ from the one where the message is actually stored.
      Available for: OS/400
    • MSG_MISC
      Various additional message information (16-bit field).
      Available for: OS/400
      Values:
      • Bit 01(corresponds to  X'80')
        DISPLAY_UD_MSG
        Displays UD messages
      • Bit 02 (corresponds to X'40')
        DISPLAY_ONLY_UD_MSG
      • Bit 03 (corresponds to X'20')
        QUEUE_BY_ID_ONLY
      • Bit 04 (corresponds to X'10')
        QUEUE_BY_AUTO
        Queue by automation
      • Bit 05 (corresponds to X'08')
        QUEUE_BY_HARDCOPY
      • Bit 06 (corresponds to X'04')
        Reserved
      • Bit 07 (corresponds to X'02')
        Reserved
      • Bit 08 (corresponds to  X'01')
        Reserved
      • Bit 09 (corresponds to  X'80')
        ECHO_OPERATOR_CMD
        Echo operator command
      • Bit 10 (corresponds to  X'40')
        ECHO_INTERNAL_CMD
        Echo internal command
      • Bit 11 (corresponds to  X'20')
        RESULT_OF_WTL_MACRO
      • Bit 12 (corresponds to  X'10')
        Reserved
      • Bit 13 (corresponds to  X'08')
        Reserved
      • Bit 14 (corresponds to  X'04')
        Reserved
      • Bit 15 (corresponds to  X'02')
        Reserved
      • Bit 16 (corresponds to  X'01')
        Reserved
    • MSG_SEVERITY
      Severity of the received message

      Available for: OS/400
      Allowed values: 0-99
    • MSG_TEXT
      Message text (default value)

      Available for: BS2000, z/OS, and OS/400
    • MSGNR
      Message number

      Available for: BS2000
    • MSGTYPE, MSGTYP
      Retrieves the message type
      Available for: BS2000 and OS/400
      Allowed values:
      (especially for OS/400)
      • 01
        Completion
      • 02
        Diagnostic
      • 04
        Information
      • 05
        Inquiry
      • 06
        Sender's copy
      • 08
        Request
      • 10
        Request with s prompt
      • 14
        Notification (exception has already been handled)
      • 15
        Abort message (exception has already been handled)
      • 16
        Notification (exception has not yet been handled)
      • 17
        Abort message (exception has not yet been handled)
      • 21
        Response, validity has not yet been checked
      • 22
        Response, validity has been checked
      • 23
        Response, default message is used
      • 24
        Response, system default message is used
      • 25
        Response from the from system response list
    • OS_NAME
      Name of the operating system in the console message defined by IBM. Currently, this name is always MVS

      Available for: z/OS
    • PARTY
      Partner

      Available for: SAP XI
    • PROCESSID
      Task number (TSN) in the console message

      Available for: BS2000
    • PROGRAM_NAME
      Program description

      Available for: Automatic z/OS FILE events
    • REPLY_ID
      Reply ID of the console message

      Available for: z/OS
    • RESULT
      Indicates whether the conditions of file system events with the checks FILESIZE or PATH_FILE_COUNT were fulfilled.

      Available for: FILE events
      (FILE events only) You must set the Check Conditions of FILE events to FILE_SIZE or empty, regardless if combined with FILE_STABLE or FILE_CHANGEd; and PATH_FILE_COUNT which must be combined with FILE_STABLE or FILE_CHANGED. For more information, see File Event Attributes.
      Allowed values:
      • Y
        The condition was fulfilled
      • N
        The condition was not fulfilled
      REPLY1
      Allows access to the SQL query result for "Value 1
      ". In Index, specify the column number whose value should be read.
      Important! A database event only reads the first 10 columns. Column contents that exceed 255 characters are truncated. The value " " is returned if you try to access a non-existing column.

      Available for: DB events
    • REPLY2
      Allows access to the SQL query result for "Value 2
      ". In Index, specify the column number whose value should be read.
      Important! A database event only reads the first 10 columns. Column contents that exceed 255 characters are truncated. The value " " is returned if you try to access a non-existing column.

      Available for: DB events
    • RETCODE
      Return code of the job in converted format. For more information, see Return Codes of z/OS Jobs

      Available for: Automatic z/OS FILE events
    • RETCODE_STATE
      Filter specification for the return code

      Available for: Automatic z/OS FILE events
      Allowed values:
      • Y
        A filter has been set for the return code
      • N
        The return code is not relevant for event triggering
    • SEND_JOB
      Name of the job that was used to send the received message

      Available for: OS/400
    • SEND_JOB_NUMBER
      Number of the job that was used to send the received message

      Available for: OS/400
    • SEND_USER_PROFILE
      Name of the user profile that was used to send the received message

      Available for: OS/400
    • SERVICE
      Service

      Available for: SAP XI and Automatic z/OS FILE events
    • SMS_MANAGEMENT_CLASS, SMS_DATA_CLASS, SMS_STORAGE_CLASS
      Name of the class

      Available for: Automatic z/OS FILE events
    • SOURCE
      Source of the event

      Available for: Windows
    • STATE
      Status

      Available for: SAP XI
      Allowed values:
      • *
      • ERROR
      • OK
      • INACTIVE
      • UNKNOWN
      • UNREGISTERED
    • STEP_NAME
      Name of the job step

      Available for: Automatic z/OS FILE events
    • SYS_NAME
      User-defined system name

      Available for: z/OS, Automatic z/OS FILE events
    • SYSPLEX_NAME
      SYSPLEX name

      Available for: z/OS, Automatic z/OS FILE events
    • TIMESTAMP
      Date and time of the console message
      Available for: BS2000, z/OS, OS/400, SAP ABAP, SAP Java, Windows, FILE events, Automatic z/OS FILE events
      (FILE events only) You must set the Check Conditions of FILE events to FILE_SIZE or empty, regardless if combined with FILE_STABLE or FILE_CHANGEd; and PATH_FILE_COUNT which must be combined with FILE_STABLE or FILE_CHANGED. For more information, see File Event Attributes.
    • TYPE
      Type of the event

      Available for: Windows
      Allowed values:
      • I
        Information
      • W
        Warning
      • E
        Error
      • S
        Success audit
      • F
        Failure audit
    • USER
      User

      Available for: Windows
  • Index
    (Optional) Can only be used together with one of the following keywords:
    • INSERT
      Provides access to the 16-bit fields of an z/OS console message and access to the variable part (insert) of an OS/400 message text
    • RESULT1
      Returns the column number of the SQL query (database event)
    • RESULT2
      Returns the column number of the SQL query (database event)
    • MSG_DESCRIPTOR
    • MSG_LEVEL
    • MSG_MISC
    Format: script literal, number or script variable
    Default: 1

Platform-specific Features

  • z/OS
    The keywords MSG_DESCRIPTOR, MSG_LEVEL, and MSG_MISC, are special features. They are 16-bit fields, of which each bit has a specific meaning. You can query each bit with this script function. You can do so by giving the bit a value or a constant with Index. The value returned by this script function is "1" (bit is set) or "0" (bit is not set).

  • OS/400
    With INSERT_COUNT as the keyword, you can establish the number of variable parts of a message in an OS/400 message. With INSERT as the keyword and by specifying the Index, a specific variable part of a message can be accessed. Without Index, the function returns the first variable part of the message.

Examples

The GET_CONSOLE function is used to retrieve the TSN of the process that triggered the event:

:SET &PROCESS_ID# = GET_CONSOLE(PROCESSID)

The second example determines the number of variable parts of the message text (inserts) of an OS/400 message. Then, a process loop runs where all inserts are written in the activation report.

:SET &COUNT# = GET_CONSOLE("INSERT_COUNT")
:
SET &IDX# = 1
:
WHILE &COUNT# > 0
:   
SET &INSERT# = GET_CONSOLE("INSERT", &IDX#)
:   
SET &HELP# = FORMAT(&IDX#, "000")
:   
PRINT "INSERT[&HELP#] = '&INSERT#'"
:   
SET &IDX# = ADD(&IDX#, 1)
:   
SET &COUNT# = SUB(&COUNT#, 1)
:
ENDWHILE

The following lines are logged in the activation report:

20220110/235011.000 - U0020408 INSERT[001] = 'QPFRMON'
20220110/235011.000 - U0020408 INSERT[002] = 'QPGMR'
20220110/235011.000 - U0020408 INSERT[003] = '007982'
20220110/235011.000 - U0020408 INSERT[004] = '23:48:43'
20220110/235011.000 - U0020408 INSERT[005] = '20/01/01'
20220110/235011.000 - U0020408 INSERT[006] = '0'

The third example retrieves a component of the console message in z/OS. Bit 03 of the MSG_DESCRIPTOR keyword is accessed. Bit 03 is given either as a value or a constant.

:SET &RET# = GET_CONSOLE("MSG_DESCRIPTOR", 3)

:SET &RET# = GET_CONSOLE("MSG_DESCRIPTOR", "EVENTUAL_ACTION")

The following example shows a script excerpt that retrieves the file name and reads the file content line by line.

:SET &FILE_NAME# = GET_EVENT_INFO (FILENAME)
:
SET &HND# = PREP_PROCESS_FILE ("MVSHOST", &FILE_NAME#)

The fifth example reads the values of an SQL query for Value 1 in a database event.

SQL results:

Last name: Smith
First name: John
Location: Seattle

The first name is retrieved as shown below:

:SET &First name# = GET_EVENT_INFO (RESULT1, 2)

The following line supplies the location:

:SET &Location# = GET_EVENT_INFO (RESULT1, 3)

See also: