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.

  • GET_CONSOLE

    • 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 Console (CONS) Event Objects.
  • GET_EVENT_INFO

    Retrieves information from the scripts of FILE events where z/OS provides specific keywords.

Syntax

GET_CONSOLE (Keyword[, Index])

GET_EVENT_INFO (Keyword[, Index])

Parameters

Parameter Description Format/Allowed Values
Keyword

Defines the message part that should be read. See the Allowed Keywords table below for the complete list.

AE name, script literal or script variable
Index

(Optional) Can only be used in combination with the keyword INSERT, RESULT1 and RESULT2.

  • For INSERT: Access to the 16-bit fields of an z/OS console message and access to the message text's variable part (insert) of an OS/400 message.
  • For RESULT1 and RESULT2: Column number of the SQL query (database event).

Script literal, number or script variable.

Default: 1

Allowed Keywords

Keyword Description Available for Allowed Values/Notes
ACCESS File access. Automatic z/OS FILE events CLOSE: Closes the file.
ACTIVATIONSTATE Adapter status. SAP XI
  • STARTED

  • STOPPED

ALERT_OPTION Returns if and when an SNA alert is created and sent to the message. OS/400 and Windows
  • DEFER: Alert sent after local problem analysis.
  • IMMED: Alert sent immediately (message queue attribute permitting alerts must be *YES).
  • NO: No alert is sent.
  • UNATTEND: Alert sent only if system runs in non-monitored mode (ALERTS is *UNATTEND).
CATEGORY Event category. Windows n.a.
CHANNEL Communication channel. SAP XI n.a.
DDNAME DD description. Automatic z/OS FILE events n.a.
EVENT_ADDITIONAL_PARM Additional parameters of SAP Java Scheduler events. SAP Java n.a.
EVENT_COUNTOFJOBS Number of triggered SAP jobs (ABAP). SAP ABAP n.a.
EVENT_GUID SAP event's instance number (ABAP). SAP Java n.a.
EVENT_ID Event ID (ABAP/Java Events). SAP ABAP, SAP Java, and Windows n.a.
EVENT_PARM SAP event parameter (ABAP/Java events). SAP ABAP and SAP Java n.a.
EVENT_PROCESSSTATE SAP processing status (ABAP). SAP ABAP n.a.
EVENT_SERVER SAP-event server (ABAP). SAP ABAP n.a.
EVENT_STATE SAP event status (ABAP). SAP ABAP n.a.
EVENT_TYPE SAP Java Scheduler event type. SAP Java n.a.
FILENAME Name of the file.

FILE events, Automatic z/OS FILE events

  • (FILE Events only) Set the following:

    • Check Conditions to FILE_SIZE or empty

    • Combine PATH_FILE_COUNT with FILE_STABLE or FILE_CHANGED

    For more information, see File Event Attributes.

  • FILE events with wildcards return:

    • *ALL (If All files must match is selected).

    • *ONE (If One file must match is not selected.

FILESIZE Size of the file. FILE events

(FILE events only) Set the following:

  • Check Conditions to FILE_SIZE or empty

  • PATH_FILE_COUNT combined with FILE_STABLE or FILE_CHANGED

ID Message ID. SAP XI n.a.
INFO_ACTION Action. Automatic z/OS FILE events YES (An object has been activated), NO (No object has been activated)
INFO_TEXT Name of the activated object. Automatic z/OS FILE events n.a.
INSERT Accesses a certain variable part of a message together with Index. OS/400 and Windows n.a.
INSERT_COUNT Determines the number of the message's variable part. OS/400 and Windows n.a.
INSERT_ID Retrieves the identification of the job. Automatic z/OS FILE events and z/OS n.a.
INSERT_NAME Retrieves the identification of the job. Automatic z/OS FILE events and z/OS n.a.
JOB_ABENDED End status of the job which closed the file. Automatic z/OS FILE events
  • YES (Job ended abnormally)

  • NO (Job ended normally)

JOB_ENDED Status of the job which closed the file. Automatic z/OS FILE events
  • YES (Job has already ended)

  • NO (Job still running)

JOB_NAME Name of the job. Automatic z/OS FILE events and z/OS n.a.
LPAR_NAME Returns the LPAR name. Automatic z/OS FILE events and z/OS n.a.
MEMGEN Member name or generation number. Automatic z/OS FILE events n.a.
MSG_DESCRIPTOR Description of the message as a 16-bit field. z/OS
  • Bit 01 (X'80'): SYSTEM_FAILURE
  • Bit 02 (X'40'): IMMEDIATE_ACTION (Immediate Action Required)
  • Bit 03 (X'20'): EVENTUAL_ACTION (Eventual Action Required)
  • Bit 04 (X'10'): SYSTEM_STATUS
  • Bit 05 (X'08'): IMMEDIATE_COMMAND (Immediate Command Response)
  • Bit 06 (X'04'): JOB_STATUS
  • Bit 07 (X'02'): APPLICATION (Application program/ processor)
  • Bit 08 (X'01'): OUT_OF_LINE
  • Bit 09 (X'80'): OPERATOR_REQUEST
  • Bit 10 (X'40'): TRACK_COMMAND_R (Track command response)
  • Bit 11 (X'20'): CRITICAL_ACTION (Critical eventual action)
  • Bit 12 (X'10'): IMPORTANT_INFO
  • Bit 13 (X'08'): PREVIOUSLY_AUTO (Previously automated)
  • Bits 14 - 16: Reserved
MSG_FILE_LIBRARY Name of the library containing the message file or the values "*CURLIB" or "*LIBL" used by the send program. OS/400 n.a.
MSG_FILE_NAME Name of the message file which contains the obtained message. OS/400 n.a.
MSG_ID Message ID of the received message. OS/400 This field is left blank if an improvised message is obtained.
MSG_KEY Message key of the obtained message. OS/400 Four-figure value in hexadecimal format X'xxxxxxxx'.
MSG_LEVEL Urgency level of the message (16-bit field). z/OS
  • Bit 01 (X'80'): WTOR
  • Bit 02 (X'40'): IMMEDIATE_ACTION
  • Bit 03 (X'20'): CRITICAL_ACTION (Critical eventual action)
  • Bit 04 (X'10'): EVENTUAL_ACTION (Eventual action required)
  • Bit 05 (X'08'): INFO (Informational)
  • Bit 06 (X'04'): BROADCAST
  • Bits 07 - 16: Reserved
MSG_LIBRARY_USED Real name of the library which is used to send the message. OS/400 The library can contain overriding instructions. Thus, this is not necessarily the library in which the message is actually stored.
MSG_MISC Various additional message information (16-bit field). OS/400
  • Bit 01 (X'80'): DISPLAY_UD_MSG (Displays UD messages)
  • Bit 02 (X'40'): DISPLAY_ONLY_UD_MSG
  • Bit 03 (X'20'): QUEUE_BY_ID_ONLY
  • Bit 04 (X'10'): QUEUE_BY_AUTO (Queue by automation)
  • Bit 05 (X'08'): QUEUE_BY_HARDCOPY
  • Bits 06 - 08: Reserved
  • Bit 09 (X'80'): ECHO_OPERATOR_CMD (Echo operator command)
  • Bit 10 (X'40'): ECHO_INTERNAL_CMD (Echo internal command)
  • Bit 11 (X'20'): RESULT_OF_WTL_MACRO
  • Bits 12 - 16: Reserved
MSG_SEVERITY Severity of the obtained message. OS/400 Allowed values: 0 to 99
MSG_TEXT Message text (default value). BS2000, z/OS, and OS/400 n.a.
MSGNR Message number. BS2000 n.a.
MSGTYPE, MSGTYP Retrieves the message type. BS2000 and OS/400

OS/400 specific values:

  • 01: Completion
  • 02: Diagnostic
  • 04: Information
  • 05: Inquiry
  • 06: Sender's copy
  • 08: Request
  • 10: Request with a prompt
  • 14: Notification (exception handled)
  • 15: Abort message (exception handled)
  • 16: Notification (exception not handled)
  • 17: Abort message (exception not handled)
  • 21: Response, validity not checked
  • 22: Response, validity checked
  • 23: Response, default message used
  • 24: Response, system default message used
  • 25: Response from the system response list
OS_NAME Name of the operating system in the console message defined by IBM. z/OS Currently, this name is always MVS.
PARTY Partner. SAP XI n.a.
PROCESSID Task number (TSN) in the console message. BS2000 n.a.
PROGRAM_NAME Program description. Automatic z/OS FILE events n.a.
REPLY_ID Reply ID of the console message. z/OS n.a.
RESULT Indicates whether the conditions of file system events with the checks FILESIZE or PATH_FILE_COUNT were fulfilled. FILE events
  • Y (Condition fulfilled)

  • N (Condition not fulfilled).

RESULT1 Allows access to the SQL query result for "Value 1". DB events 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.
RESULT2 Allows access to the SQL query result for "Value 2". DB events 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.
RETCODE Return code of the job in converted format. Automatic z/OS FILE events For more information, see Return Codes of z/OS Jobs.
RETCODE_STATE Filter specification for the return code. Automatic z/OS FILE events
  • Y (Filter has been set for return code)

  • N (Return code is not relevant).

SEND_JOB Name of the job that was used to send the received message. OS/400 n.a.
SEND_JOB_NUMBER Number of the job that was used to send the received message. OS/400 n.a.
SEND_USER_PROFILE Name of the user profile that was used to send the received message. OS/400 n.a.
SERVICE Service. SAP XI and automatic z/OS FILE events n.a.
SMS_MANAGEMENT_CLASS, SMS_DATA_CLASS, SMS_STORAGE_CLASS Name of the class. Automatic z/OS FILE events n.a.
SOURCE Source of the event. Windows n.a.
STATE Status. SAP XI
  • *

  • ERROR

  • OK

  • INACTIVE

  • UNKNOWN

  • UNREGISTERED

STEP_NAME Name of the job step. Automatic z/OS FILE events n.a.
SYS_NAME User-defined system name. z/OS and automatic z/OS FILE events n.a.
SYSPLEX_NAME SYSPLEX name. z/OS and automatic z/OS FILE events n.a.
TIMESTAMP Date and time of the console message. BS2000, z/OS, OS/400, SAP ABAP, SAP Java, Windows, FILE events, and automatic z/OS FILE events Subject to identical constraints as defined for the FILENAME keyword.
TYPE Type of the event. Windows
  • I: Information
  • W: Warning
  • E: Error
  • S: Success audit
  • F: Failure audit
USER User. Windows n.a.

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