GET_CONSOLE, GET_EVENT_INFO
Script Function: Reads values of occurred Console, FileSystem and Database events.
Syntax
GET_CONSOLE (Keyword[, Index])
GET_EVENT_INFO (Keyword[, Index])
Syntax |
Description/Format |
---|---|
Keyword |
Specifies the message part which should be read The table shown below explains the keywords for the individual platforms: |
Index |
Can only be used in combination with the keyword INSERT, RESULT1 and RESULT2. Format: script literal, number or script variable. Default value: 1 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) |
Keywords
Keyword |
Console |
Console |
Console |
Console |
Console |
Console SAP (Java) |
Console |
File system |
File system |
Database |
---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
EVENT_ADDITIONAL_PARM | ||||||||||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
EVENT_TYPE | ||||||||||
|
|
|
|
|
|
|
||||
FILESIZE | ||||||||||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
RESULT | ||||||||||
RESULT1 | ||||||||||
RESULT2 | ||||||||||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
Note that the keys listed in the "FileSystem" column can only be used in FileSystem events with the setting "Check" equals "FILE_SIZE" or "empty" (with or without a combination of "FILE_STABLE" or "FILE_CHANGED") and "PATH_FILE_COUNT" (only in combination with "FILE_STABLE" or "FILE_CHANGED").
Description
Keyword |
Description |
---|---|
File access |
|
Adapter status Allowed values: "STARTED" and "STOPPED" |
|
Returns if and when an SNA alert is created and sent to the message Allowed values: |
|
Event category |
|
Communication channel |
|
DD description |
|
EVENT_ADDITIONAL_PARM | Additional parameters of SAP Java Scheduler events |
Number of triggered SAP jobs (ABAP) |
|
SAP event's instance number (ABAP) |
|
Event ID (ABAP/Java Events) |
|
SAP event parameter (ABAP/Java events) |
|
SAP processing status (ABAP) |
|
SAP-event server (ABAP) |
|
SAP event status (ABAP) |
|
EVENT_TYPE | SAP Java Scheduler event type |
Name of the file In File-System events with wildcards, the following value is returned as a file name:
|
|
FILESIZE | Size of the file |
Message ID |
|
Action Allowed values: "Y" and "N" |
|
Name of the activated object |
|
Accesses a certain variable part of a message together with Index |
|
Determines the number of the message's variable part |
|
End status of the job which closed the file Allowed values: "Y" and "N" |
|
Status of the job which closed the file Allowed values: "Y" and "N" |
|
Identification name of the job |
|
Returns the LPAR name |
|
Name of the job |
|
Member name or generation number |
|
Description of the message as a 16-bit field Bit 01(corresponds to X'80') = SYSTEM_FAILURE - system failure |
|
Name of the library containing the message file or the values "*CURLIB" or "*LIBL" used by the send program |
|
Name of the message file which contains the obtained message |
|
Message key of the of the obtained message |
|
Message key of the obtained message |
|
Urgency level of the message (16-bit field). Bit 01(corresponds to X'80') = WTOR - WTOR |
|
Real name of the library which is used to send the message |
|
Miscellaneous message information (16-bit field). Bit 01(corresponds to X'80') = DISPLAY_UD_MSG - display UD messages |
|
Severity of the obtained message Allowed values: "0" to "99" |
|
Message text (default value) |
|
Message number |
|
Message type Allowed values especially for OS/400: "01" - Completion |
|
Name of the operating system in the console message defined by IBM. Currently always "MVS" |
|
Partner |
|
Task number (TSN) in the console message |
|
Program description |
|
Reply ID of the console message. |
|
RESULT |
Indicates whether the conditions of FileSystem events with the checks FILESIZE or PATH_FILE_COUNT were fulfilled. Allowed values: "Y" and "N" |
RESULT1 RESULT2 |
RESULT1 allows access to the SQL query result for "Value 1", RESULT2 to the result for "Value 2". In index specify the column number whose value should be read. Note that a database event only reads the first 10 columns. Columns contents exceeding 255 characters are truncated. The script function supplies the value " " if an attempt is made to access a non-existing column. |
Return code of the job in converted format |
|
Filter specification for the return code Allowed values: "Y" and "N" |
|
Name of the job in which the received message was sent |
|
Job number of the job which the received message was sent |
|
Name of the user profile which sent the received message |
|
Service |
|
Name of the class |
|
Source of the event |
|
Status Allowed values: |
|
Name of the job step |
|
User-defined system name |
|
SYSPLEX name |
|
Date and time of the console message |
|
Type of the event Allowed values: "I" - information |
|
User |
Comments
The script elements GET_CONSOLE and GET_EVENT_INFO can be used to retrieve information about an occurred event. They have the same syntax.
With the script function GET_CONSOLE, message data can be retrieved when console events occur. This data consists of defined components of the console message, which can be specified with keyword. By default, this function returns the message text.
This script function can be used in the event type "Console". The console message can be read with this in BS2000 and in z/OS. In OS/400, this script function is used to receive information from a message queue. The message queue to be monitored can be specified in the INI file of the OS/400 agent.
GET_EVENT_INFO can be used to read information in the scripts of File System events. Especially z/OS provides several keywords.
Platform Specific Features
z/OS
The keywords MSG_DESCRIPTOR, MSG_LEVEL and MSG_MISC represent special features. They are 16-bit fields of which each individual bit has a specific meaning. Each individual bit can be queried with this script function. This can be done 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 a 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 function GET_CONSOLE is used to retrieve the TSN of the process which triggered the event.
:GET_CONSOLE(PROCESSID)
In the second example, first the number of the variable part of the message of a OS/400 message is determined. Then, a process loop runs in which 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:
20010110/235011.000 - U0020408 INSERT[001] = 'QPFRMON'
20010110/235011.000 - U0020408 INSERT[002] = 'QPGMR'
20010110/235011.000 - U0020408 INSERT[003] = '007982'
20010110/235011.000 - U0020408 INSERT[004] = '23:48:43'
20010110/235011.000 - U0020408 INSERT[005] = '10/01/01'
20010110/235011.000 - U0020408 INSERT[006] = '0'
In the third example, a component of the console message in z/OS is requested. Bit 03 of the keyword MSG_DESCRIPTOR 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 which 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 | First name | Location |
---|---|---|
Smith | John | 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:
Script element | Description |
---|---|
Checks if a bit is set in a bit field |
Script Elements - Event Handling
Sample Collection
Reaction to External Events
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by function