Previous Topic: Basic FormatNext Topic: OPSLOG Function Return Codes


Expanded Format

This function is universal for calling from OPS/REXX scripts, CLIST scripts, or from the TSO environment and has the following format:

var = OPSLOG('opcode TIME(value) DATE(ddmmmyyyy)|MSGNUM(number) [optional keywords] ')
{opcode}
{TIME(hh:mm:ss|-sec) DATE(ddmmmyyy)|MSGNUM(number)}
{ENDTIME(hh:mm:ss|+sec) ENDDATE(ddmmmyyyy) ENDMSGNUM(message number)}
[MSGCOUNT(n)]
[LOGNAME(logname)]
[JOBNAME(jobname1,...jobname8)]
[MSGID(msgid1,...msgid8)]
[SYSNAME(sysna1,...sysna4)]
[USER(user1,...user4)]
[COLORS(color1,...color4)]
[RULESET(ruleset1.rulename1,ruleset2.rulename2)]
[EVENTTYPE(evntype1,...evntype20)]              
[ASID(asid1,...asid4)]                          
[EXITTYPE(exttype1,...exttype3)]                
[SCANTEXT1('Case sensitive text',fromcol,tocol)]
[SCANTEXT2('Case sensitive text',fromcol,tocol)]
[SCANTEXT3('Case sensitive text',fromcol,tocol)]
[OUTCOLS(outcol1,...,outcol44)
[CMDRESP(XDQ|REXX|CLIST|TERM)]
[PREFIX(variable prefix)]
[SUBSYS(ssid)]
[SYSTEM(msfid)]
[SYSWAIT(syswait)]
[DDNAME(ddname)]
[MSGNUM(msgnum)]
[ENDMSGNUM(endmsgnum)]
[CONSNAME(consname)]
[JOBID(jobid)]
[TZO(time zone offset)]
[TZADJ(8byte hex time zone adjustment)]
opcode

Supports either the EXTRACT option or the EXTOPMO option. The EXTRACT option creates a line of output for each message, suitable for automation, whereas the EXTOPMO option creates a control block that is suitable for use with the OPSLOGMG function to load a read-only OPSLOG.

TIME(hh:mm:ss|-sec) DATE(ddmmmyyyy) | MSGNUM(number)

Lets you start message selection at an explicit date, an explicit time, or both. Specify time as hh:mm:ss or as a negative-seconds offset relative to the current time. Alternatively, start message selection at an explicit OPSLOG message number. This option is useful when many messages are logged simultaneously.

TIME(hh:mm:ss|-sec)

hh:mm:ss selects messages starting at the specified time or later, when no messages exist at the indicated time. The minimum specification for TIME is h. When TIME is omitted and DATE is specified, the time 00:00:00 is assumed. When minutes or seconds are specified, the value must be two numeric digits.

-sec indicates a relative time offset. Selected messages are retrieved, starting from the current time minus the indicated number of seconds.

DATE(ddmmmyyyy)

ddmmmyyyy selects messages starting at the specified date or later, when messages exist on the indicated date. The mmm portion of the date must be one of the three-letter month abbreviations; for example, JAN for January. The year can be four digits, the last two digits, or omitted for the current year. When DATE is omitted the current date is assumed.

Note: The year portion can be either 'nothing' (default to current year), 'yy' (last two digits of the yyyy format), 'yyyy' (all four characters of the yyyy format).

Valid OPSLOG function calls with various date specifications follow:

rtvl = OPSLOG('Extract TIME(-10) DATE(22JUL)')
rtvl = OPSLOG('Extract TIME(-10) DATE(22JUL11)')
rtvl = OPSLOG('Extract TIME(-10) DATE(22JUL2011)')
MSGNUM(number)

MSGNUM is the exact OPSLOG sequence number of the starting message. Starting with the MSGNUM specified message, all messages numbered are retrieved.

Note: TIME and DATE keywords are mutually exclusive with MSGNUM.

Example: Retrieve Messages by Specific Time of Day

This example retrieves messages that were logged starting at 10:15:00 AM:

TIME(10:15:00)

Example: Retrieve Messages by Specific Time of Day and Date

This example retrieves messages that were logged starting at 8:20 AM on July 7:

TIME(08:20) DATE(07JUL)

Example: Retrieve Messages by Time Offset

This example retrieves messages that were logged starting 240 seconds ago:

TIME(-240)

Example: Retrieve Messages by Number

This example retrieves messages that have absolute sequence numbers with a value of 10 or greater:

MSGNUM(10)

ENDTIME(hh:mm:ss|-sec) ENDDATE(ddmmmyyyy) ENDMSGNUM(number)

Lets you terminate message selection at an explicit date, an explicit time, or both. Specify time as hh:mm:ss or as a positive-seconds offset relative to the current time. Alternatively, stop message selection at an explicit OPSLOG message number. These criteria override the default MSGCOUNT value as a stopping criteria..

ENDTIME(hh:mm:ss|+sec)

hh:mm:ss selects messages starting at the specified time or later, when no messages exist at the indicated time. The minimum specification for ENDTIME is h. When ENDTIME is omitted and ENDDATE is specified, the time 00:00:00 is assumed. When minutes or seconds are specified, the value must be two numeric digits.

+sec indicates a relative time offset. Selected messages are retrieved from the starting time to the current time plus the indicated number of seconds.

ENDDATE(ddmmmyyyy)

ddmmmyyyy terminates message selection at the specified date and optional ENDTIME when messages exist on the indicated date. The mmm portion of the date must be one of the three-letter month abbreviations; for example, JAN for January. The year can be four digits, the last two digits, or omitted for the current year. When ENDDATE is omitted and ENDTIME is specified the DATE keyword value is assumed.

Note: The year portion can be either 'nothing' (default to current year), 'yy' (last two digits of the yyyy format), 'yyyy' (all four characters of the yyyy format).

Valid OPSLOG function calls with various date specifications follow:

rtvl = OPSLOG('Extract TIME(-10) ENDATEDATE(22JUL)')
rtvl = OPSLOG('Extract TIME(-10) ENDDATE(22JUL11)')
rtvl = OPSLOG('Extract TIME(-10) ENDDATE(22JUL2011)')
ENDMSGNUM(number)

ENDMSGNUM is the exact OPSLOG sequence number of the last message to be retrieved or the highest used message number in the OPSLOG. Unlike MSGNUM, ENDMSGNUM may be specified along with ENDTIME and ENDDATE. The first end selection criteria encountered will be honored.

MSGCOUNT(n)

(Optional) Specifies the maximum number of messages to be retrieved and must be a positive number. The value that is returned from OPSLOG is the real number of lines retrieved. The size of the external data queue and the REXX workspace size limit the number of messages that can actually be retrieved.

Default: 1000

Example: Retrieve a Maximum Number of Messages

This example retrieves up to 500 messages.

MSGCOUNT(500)
LOGNAME(logname)

(Optional) Retrieves a particular OPSLOG by name.

Limit: Up to 16 characters.

Default: LIVE

Example: Retrieve Messages from a Particular OPSLOG by Name

This example retrieves messages from the OPSLOGBCK log:

LOGNAME(OPSLOGBCK)

JOBNAME(jobname1,...,jobname8)

(Optional) Filters retrieved messages that are generated by specific jobs.

Note

:

Use \ in front of the event identifier to exclude it from retrieval.

Note: You can filter using a wildcard *.

Limit: Up to eight characters plus one character for the exclusion character (\).

Example: Retrieve Messages Generated by a Particular Job

This example filters retrieved messages by job name MYJOB:

JOBNAME(MYJOB)

MSGID(msgid1,...,msgid8)

(Optional) Retrieves messages according to their specific event identifier.

Note

:

Use \ in front of the event identifier to exclude it from retrieval.

Note: You can filter using a wildcard *.

Limit: Up to ten characters plus one character for the exclusion character (\).

Example: Retrieve Messages by Message ID

This example only retrieves messages with the event identifier IEF403I:

MSGID(IEF403I)

SYSNAME(sysna1,...,sysna4)

(Optional) Retrieves messages that are generated on a specific system.

Note

:

Use \ in front of the event identifier to exclude it from retrieval.

Note: You can filter using a wildcard *.

Limit: Up to eight characters plus one character for the exclusion character (\).

Example: Retrieved Messages by the System on Which They Were Created

This example filters retrieved messages that were created on the system:

SYSNAME(PROD1)
USER(user1,…,user4)

(Optional) Retrieves messages with the event user data value from the last AOF rule processed.

Note

:

Use \ in front of the event identifier to exclude it from retrieval.

Note: You can filter using a wildcard *.

Limit: Up to eight characters plus one character for the exclusion character (\).

COLORS(color1,...,color4)

(Optional) Retrieves messages according to the color of the message.

Note: Use \ in front of the keyword to exclude it from the filter.

Possible Values: GREEN, BLUE, RED, WHITE, PINK, YELLOW, TURQ

Example: Retrieve Messages by Specific Colors

This example filters retrieved messages that are either GREEN or PINK:

COLORS(GREEN,PINK)

RULESET(ruleset1.rulename1,ruleset2.rulename2)

(Optional) Retrieves messages according to the first ruleset.rulename that processed the event.

Note: Use \ in front of the keyword to exclude it from the filter.

Note: You can filter using a wildcard *.

Example: Retrieve Messages First Processed by a Specific Rule

The following example filters messages that are first processed by the rule OPSTEST in ruleset TEST:

RULESET(TEST.OPSTEST)

Example: Exclude Messages First processed by a Specific Ruleset:

The following example excludes messages that are processed by any rule in ruleset TEST:

RULESET(\TEST.*)

Example: Retrieve Messages First Processed by a Specific Rule

The following example filters messages that are first processed by the rule OPSTEST in any ruleset:

RULESET(*.OPSTEST)

EVENTTYPE(evntype1,...,evntype20)

(Optional) Filters returned messages according to event type.

Note: Use \ in front of the keyword to exclude it from the filter

Possible Values: MSG, RUL, CMD, DIS, DOM, ENA, EOM, GLV, OMG, REQ, SEC, TOD, SCR, ARM, EOS, EOJ, TLM, USS, API, ALL

Example: Retrieve Messages by Event Type

The following example filters messages by the MSG event type:

EVENTTYPE(MSG)

ASID(asid1,...,asid4)

(Optional) Retrieves messages that are generated by the address space identifier of the creator of the event.

Limit: Up to four ASIDs could be specified, each with a four-character hexadecimal value.

Example: Retrieves Messages by Address Space Identifiers:

The following example filters messages by ASID 028F:

ASID(028F)

EXITTYPE(exttype1,...,exttype3)

(Optional) Retrieves messages according to the exit type that captured the event.

Possible Values: NONE, MVS, JES3, IMS, OMG, DSN, TRA, NIP, CICS, CNSV, CA7

Example: Retrieve Messages by Exit Type

This example filters messages by the JES3 exit type:

EXITTYPE(JES3)

SCANTEXT1('text',fromcol,tocol)
SCANTEXT2('text',fromcol,tocol)
SCANTEXT3('text',fromcol,tocol)

(Optional) Retrieve messages with specific case-sensitive text between the variables fromcol and tocol.

Example: Search for a Text String Between Two Columns

This example searches for the text string "my text" between columns 1 and 7:

SCANTEXT1('my text',1,7)
OUTCOLS(outcol1,...,outcol44)

(Optional) Chooses the columns to be displayed in word-delimited output record order before the message text. Column data is displayed in the order that column names are specified. Each column value is a single REXX word except for ROUTE and ROUTEX, which create two words. Blank or null values are replaced with the value NONE. The column values correspond to the values displayed by the OPSVIEW OPSLOG dialog, except where a blank value is encountered.

Note: The OUTCOLS keyword is ignored for opcode EXTOPMO with DDNAME specified.

Possible values: JOBNAME, TIME, DATE, ASID, MSFID, MSFDEST, MSGNO, ELAPSED, SYSID, AFLAGS, FLAGS, DISP, OPSFLAGS, RELEASE, JOBNM, JOBID, AUTOTOKN, XCONID, CONID, CONSNAME, IMSID, IMSTYPE, JES3CLAS, ROUTE, WTOID, TIMESTMP, SYSNAME, LENGTH, SPECIAL, DSPNAME, USER, USERX, TERMNAME, USERID, EVENT, ADDRESS, COLOR, TOKEN, AUTOTOKX, EXITTYPE, MSGID, RULESET, COUNT, EVENTID, ROUTEX

Example: Display the TIME and JOBNAME Columns

This example displays the TIME and JOBAME columns:

OUTCOLS(TIME,JOBNAME)
CMDRESP(XDQ|REXX|CLIST|TERM)

(Optional) Determines where the output from OPSLOG is directed.

Note: The CMDRESP keyword is ignored for opcode EXTOPMO with DDNAME specified.

Possible Values:

XDQ

Specifies the external data queue.

REXX

Specifies REXX compound variables.

CLIST

Specifies CLIST variables.

TERM

Specifies output that is directed to the terminal.

The output default values of this command depend on the environment in which you are running the command. According to the execution environment in which you run OPSLOG, CMDRESP has the following output default values:

The following run-time environment and output combinations are possible:

Example: Direct Output Records

This example directs output records into REXX variables:

CMDRESP(REXX)

PREFIX(name)

(Optional) Defines a prefix name for created variables.

Note: The PREFIX keyword is ignored for opcode EXTOPMO with DDNAME specified.

Default:

For REXX variables, OPLG. (followed by a period)

For CLIST variables, OPLG (not followed by a period)

Example: Define a Prefix for Created Variables

This example defines a REXX stem variable prefix for the output variables:

PREFIX(MSGLOG.)

SUBSYS(ssid)

(Optional) Directs the OPSLOG request to a specific CA OPS/MVS subsystem name on the same system.

Example: Specify an Alternate Subsystem Name on the Same System.

This example directs the OPSLOG request to CA OPS/MVS subsystem OPSQ on the same system.

SUBSYS(OPSQ)

SYSTEM(msfid)

(Optional) Specifies the name of the remote or local MSF system that is to receive the command. The value of MSFID can contain from one to eight characters.

Limits: 1-8 characters

Note: If you have issued the MSF DEFAULT SYSTEM command, the value you specify for the SYSTEM keyword overrides any SYSTEM values you specify for the REXX program or rule.

Example: Specify the MSFID of the System that Receives the Command

This example sends the command to the system with MSFID SYSX:

SYSTEM(SYSX)

SYSWAIT(seconds)

(Optional) Specifies the maximum time that the command waits for output from the remote system.

Limits: 0-300 seconds

Note: If you have issued the MSF DEFAULT SYSWAIT command, the value you specify for the SYSWAIT keyword overrides any SYSWAIT values you specify for the REXX program or rule.

Example: Define a Wait Time of 30 Seconds

This example defines a wait time of 30 seconds:

SYSWAIT(30)

DDNAME(ddname)

(Optional) You can use DDNAME with the EXTOPMO opcode. It must be an allocated file that is opened for output that is fixed blocked with an LRECL=386. This dataset receives the output of the command. CMDRESP is ignored if DDNAME is provided.

CONSNAME(consname)

(Optional) Up to an 8-byte console name that is used for the selection of records. Wildcarding is supported using the *.

JOBID(jobid)

(Optional) Up to an 8-byte jobid that is used for selecting records. Wildcarding is supported.

TZO(time zone offset)

(Optional) The time zone offset of the local time zone. The current system value can be obtained using the OPSINFO(‘TZADJUST’) Rexx function.

Range: -23 to +23.

TZADJ(8-byte hex time zone adjustment)

(Optional) This value is the hex time zone adjustment number that you get on Z/OS systems from the CVTLDTO field of the CVT extension.

OPSLOG Function Examples

The following examples show common ways that you can use the OPSLOG function in the available environments:

Example: OPSLOG Basic Format for OPS/REXX

This example retrieves two messages from the external data queue, starting with the message issued 5 seconds ago; var represents the number of lines to be retrieved.

var = OPSLOG('L',-5,2)

Example: OPSLOG Expanded Format for OPS/REXX or TSO/E REXX

This example retrieves four messages starting with the message issued at or after 8:30 AM. The output goes to REXX compound variables with the prefix ABC. Variable ABC.0 has the count of retrieved messages. ABC.n variables contain the retrieved messages. The message time and date are prefixed to the message text. A REXX parse statement can be used to obtain the individual data elements: Parse Var ABC.1 time date msgtext.

var = OPSLOG('EXTRACT MSGCOUNT(4) TIME(08:30) OUTCOLS(TIME,DATE) CMDRESP(REXX) PREFIX(ABC)')

Example: OPSLOG Expanded Format for OPS/REXX or TSO/E REXX using opcode EXTOPMO

This example retrieves two thousand messages from the LIVE OPSLOG on system CA11 starting with the message issued at or after 8:30 AM. The output goes to the dataset allocated to DDNAME SORTOUT.

var = OPSLOG('EXTOPMO MSGCOUNT(2000) TIME(08:30) DDNAME(SORTOUT) SYSNAME(CA11)')

Example: OPSLOG Expanded Format for TSO/E Command

This example retrieves ten messages that are not generated by job JOB00001, starting at the current time minus 10 seconds. Any output records are created with the TIME and JOBNAME columns prefixed to the message text. The output goes to the terminal.

OPSLOG EXTRACT MSGCOUNT(10) TIME(-10) JOBNAME(\JOB00001) OUTCOLS(TIME,JOBNAME) CMDRESP(TERM)