Previous Topic: Basic Format

Next 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(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(cmdresp)]                  
                      [PREFIX(variable prefix)]                       
                      [SYSTEM(msfid)]                                 
                      [SYSWAIT(syswait)]                              
opcode

Currently, supports only the EXTRACT option.

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

These keywords enable you to start message selection at an explicit date and/or time. Time may be specified as hh:mm:ss or as a negative seconds offset relative to the current time. Alternatively, you may start message selection at an explicit OPSLOG message number. This could be useful when many messages are logged at the same time of day.

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 in conjunction with DATE, the current time 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 such as 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(message_number)

MSGNUM is the exact OPSLOG sequence number of the starting message. All messages numbered starting with the MSGNUM specified 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)

MSGCOUNT(n)

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

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 generated by specific jobs.

Note: Use \ in front of the job name to exclude it from retrieval.

Note: You can filter using a wildcard *.

Limit: Up to 8 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 10 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 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 8 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 8 characters plus one character for the exclusion character (\).

COLORS(color1,...,color4)

(Optional) Retrieves messages based on 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

This example filters messages first processed by the rule OPSTEST in ruleset TEST:

RULESET(TEST.OPSTEST)

Example: Exclude Messages First processed by a Specific Ruleset:

This example excludes messages that were processed by any rule in ruleset TEST

RULESET(\TEST.*)

Example: Retrieve Messages First Processed by a Specific Rule

This example filters messages first processed by 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

This example filters messages by the MSG event type:

EVENTTYPE(MSG)

ASID(asid1,...,asid4)

(Optional) Retrieves messages 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:

This example filters messages by ASID 028F:

ASID(028F)

EXITTYPE(exttype1,...,exttype3)

(Optional) Retrieves messages based on 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 searchers for the text string "my text" between columns 1 and 7.

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

(Optional) Choose columns to be displayed in word-delimited output record order prior to 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 dialogue except where a blank value is encountered.

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.

Possible Values:

XDQ

External data queue

REXX

REXX compound variables

CLIST

CLIST variables

TERM

Output is directed to the terminal

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

Example: Direct Output Records

This example directs output records into REXX variables:

CMDRESP(REXX)

PREFIX(name)

(Optional) Defines a prefix name for created variables.

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

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.

If you have issued the MSF DEFAULT SYSTEM command, the value you specify for the SYSTEM keyword overrides any SYSTEM values you may have previously specified 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. You may specify a value between 0 and 300 seconds.

If you have issued the MSF DEFAULT SYSWAIT command, the value you specify for the SYSWAIT keyword overrides any SYSWAIT values you may have previously specified 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)

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 with var representing 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 TSO/E Command

This example retrieves ten messages 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)