Previous Topic: ENQUEUE()

Next Topic: ILOGG()

ILOG()

Use the ILOG() function to return information from an ILOG subfile.

Syntax

The ILOG function has this syntax:

Form 1:

handle = ILOG(OBTAIN)

Form 2:

ILOG(POINT,handle,lognum,subfile,recnum,[direction])

Form 3:

record = ILOG(GET,handle)

Form 4:

ILOG(RELEASE,handle)

Arguments

The ILOG() function takes these arguments:

handle

Numeric ID for an internal workspace. A handle must be obtained and then passed to the function with each subsequent call.

OBTAIN

Obtains a new value for the handle argument. This value must be passed to the function on each subsequent call.

POINT

Positions to a specific record.

lognum

ILOG file number, 0 through 99.

subfile

Subfile number within the ILOG file, 0 through 9.

recnum

Record number to position to, or FIRST or LAST.

record

Returned record.

direction

Direction in which the subfile is read. Specify FORWARD or BACKWARD.

Default: FORWARD

GET

Retrieves a record. The results are placed in the ilog_ variables, as shown in the following section.

RELEASE

Releases the storage associated with handle. This is automatically performed at IMOD task termination.

Variables Returned by the GET Argument

When an ILOG record is read (GET argument), the retrieved information is placed in a series of predefined REXX variables. These variables and their use are listed next.

ilog_asid

The ASID of the issuer of the WTO.

ilog_date

The date the message was issued, in yymmdd format.

ilog_jobid

The job ID of the issuer of the WTO.

ilog_jobnm

The job name of the issuer of the WTO.

ilog_raw

The unformatted ILOG record.

ilog_seg

The number of message lines in the ILOG record.

ilog_seq

The sequence number of a record.

ilog_sysid

The GRS system name of the issuer of the WTO.

ilog_text.n

An individual line of text.

ilog_time

The time the message was issued, in hh.mm.ss format.

ilog_type

The record type set by ILOGR(). WTOs are recorded with type = 0.

Usage Notes

The ILOG() and ILOGG() functions handle records from ILOG subfiles in different ways, as explained in the following table.

Function

Treats ILOG subfiles as...

Useful for...

ILOG()

Individual files. You must specify both the ILOG file number and the specific subfile you want to process.

Copying a single subfile for archiving purposes

ILOGG()

Parts of a single file in chronological order.

Searching for all occurrences of a particular message

To read an ILOG subfile

  1. Establish linkage to an ILOG by obtaining a handle.
  2. Specify with which record the retrieval is to begin and in what direction you want to read.
  3. Read records sequentially or directly.
  4. Release the handle.

Return Codes

The ILOG() function produces these return codes:

101 - 106 ARG n MISSING OR INVALID

121 END OF LOG

122 REQUESTED LOG NOT FOUND

123 INVALID FILE HANDLE

124 REQUESTED LOG NOT ACCESSIBLE

125 REQUESTED RECORD NOT IN LOG

Example

handle = ilog('obtain')         /* Get a new handle      */
result = ilog('point',handle,0,2,'last','backward')
                                /* Start at end          */
ilog('get',handle) == ''        /* Got the last record   */
ilog_asid          == '1D'      /* For example           */
ILOGC()

Use the ILOGC() function to return information from an ILOG subfile.

Syntax

The ILOG function has this syntax:

Form 1:

result = ILOGC(OPEN, lognum)

Form 2:

result = ILOGC(CLOSE, lognum)

Form 3:

status= ILOGC(STATUS, lognum)

Arguments

The ILOGC() function takes these arguments:

OPEN

Opens the ILOG and prepares it for logging.

CLOSE

Closes the ILOG.

STATUS

Request ILOG allocation status

lognum

ILOG file number, 0 through 99.

result

null, if successful. If not successful, an error text will be returned. See Return Codes for text

status

for STATUS request, the possible status that can be returned are:

OPEN

ILOG specified by lognum is open.

CLOSED

ILOG specified by lognum is closed

OPEN NOOPEN

ILOG specified by lognum is open. ILOG was defined in RUNPARMS as NOOPEN.

CLOSED NOOPEN

ILOG specified by lognum is closed. ILOG was defined in RUNPARMS as NOOPEN

NOT-DEFINED

ILOG specified by lognum is not defined to CA GSS.

Return Codes

The ILOGR() function produces these return codes:

101 – 102

ARG n MISSING OR INVALID

122

REQUESTED LOG NOT FOUND

124

REQUESTED LOG NOT ACCESSIBLE

151

REQUESTED LOG ALREADY OPEN/|CLOSED

152

REQUESTED LOG IN USE BY ANOTHER GSS

Usage Notes

By default ILOGs are opened by CA GSS during initialization and remain open until CA GSS is terminated. The initialization parameter NOOPEN in the ILOG statement can be used to delay the opening on the ILOG dataset. The dataset then can be opened by an ILOGC(OPEN,lognum) function call. The ILOGC(CLOSE,lognum) function call can be used on any open ILOG dataset, whether it was opened during initialization or by an ILOGC function call.

Example:

/* ILOG 55 was defined to GSS with the NOOPEN option */
result=ILOGC(‘OPEN’.55)   /* open ilog 55 */
if result\='' then y=wto(result)     /* if result is not null, WTO the error text */