Logread Entry Point

PROCEDURE LOGREAD (LOGFILE, LOGRECORD, LOGBLOCK, KIND, LOGRESULT, OFFSET);
				FILE LOGFILE;
				EBCDIC ARRAY LOGRECORD, LOGBLOCK [0];
				INTEGER KIND, LOGRESULT, OFFSET;

Input

Input details are contained in the following table.

Name

Description

Logfile

The file to be read, TITLE set to required title, DEPENDENTSPECS = true

Logrecord

Pivot number of required record in COBOL PIC 9(8) COMP format. Starting in third byte (1 relative) record must be at least 2160 bytes

Logblock

Return last block returned by LOGREAD procedure to improve performance (2160 characters)

Kind

If over 10, the logfile supplied by the caller is used as the logfile. Otherwise the logfile in use by LOGLIBRARY is used if appropriate. Kind must consist of two characters in the form lf.

If I is 0 or spaces, then the Log file in use by LOGLIBRARY is used.

The values of f are:

0 = First Log file record is used

1 = read next

2 = Read record passed in Logrecord

Logresult

Ignored on input. Enter 0 (zero)

Offset

Position up to in the block, returned by LOGLIBRARY. Return this value to LOGLIBRARY with Logblock value, to read next record in block

Output

Output details are contained in the following table.

Name

Description

Logfile

None

Logrecord

The record of the Logfile requested. Refer to the description following the table for format

Logblock

The block of Logfile containing the record requested. Records are blocked up to 9 to a block. Final record ends with hexadecimal value FE. Last 4 characters of block are the first pivot number of the next block

Kind

None

Logresult

0 = Successful read, 1 = End of file, 2 = Failure

Offset

Position up to in block in half-bytes pointing to pivot number (last digit). For LOGLIBRARY use only

Logrecord Format

The Logrecord header format (with COBOL PICTURE clauses) is shown in the following table.

Format

Description

PIC 9(4) COMP

Length of record

PIC 9(10) COMP

Pivot number

PIC 9(6) COMP

Date in YYMMDD format

PIC 9(8) COMP

Time in HHMMSSTT format

PIC 9 COMP

Log from:

0 = Internal generated

1 = Standard Transaction Input from Terminal

2 = Standard Transaction Output from update

3 = From Report

4 = From HUB

5 = From User

6 = A comment

7 = A Run or Start

8 = From OLTP

PIC 9 COMP

Logtype:

0 = Invalid

1 = System Start

2 = System Stop

3 = Program/Report Start

4 = Program/Report Stop

5 = Message

6 = Unused

7 = Log released

PIC 9(4) COMP

Data record length

The remainder of the Logrecord record format depends upon the value of the Logtype as shown in the following table.

Logtype

Description

1, 2, 3, 4

152 characters, in format LOG-LINCR2

5

Input or output message logged, after 152 character header. (Refer to NOF or USER skeleton for layout)

7

152 characters. Might be ignored - no data

The Logrecord data record format is shown in the following listing, in COBOL format. The first 03 level is for comment records (LOG-LINCR) the second 03 level is for program, Report, and application starts and stops (LOG-LINCR2).

01 LOG-LINC-RECORD.
		03 LOG-LINCR.
			05 LOG-LINC-COM-TYP 				PIC 9.
			05 LOG-LINC-COM-MIX 				PIC 9(8) COMP.
			05 LOG-LINC-COM-STN 				PIC X(17).
			05 LOG-LINC-COM-LIT 				PIC X(98).
			05 FILLER 								PIC x(32).
		03 LOG-LINCR2 REDEFINES LOG-LINCR.
			05 LOG-LINC-NDX-1 					PIC 9(4) COMP.
			05 LOG-LINC-PST-PIVOT 				PIC 9(10) COMP.
			05 LOG-LINC-PCU-PIVOT 				PIC 9(10) COMP.
			05 LOG-LINC-STNNAME 				PIC X(17).
			05 LOG-LINC-PNAME 					PIC X(10).
			05 LOG-LINC-POPT 						PIC X(2).
			05 LOG-LINC-MIX 						PIC 9(8).
			05 LOG-LINC-STATUS 					PIC 99.
			05 LOG-LINC-ACTION 					PIC 9.
			05 LOG-LINC-ABORT-PIVOT 			PIC 9(10) COMP.
			05 LOG-LINC-HISTORY 				PIC 9(8) COMP.
			05 LOG-LINC-INTEGRITY 				PIC 9.
			05 LOG-LINC-FNAME 					PIC X(63).
			05 LOG-LINC-REP REDEFINES LOG-LINC-FNAME.
				20 LOG-LINC-DMS-READS 			PIC 9(6) COMP.
				20 LOG-LINC-DMS-WRITES 		PIC 9(6) COMP.
				20 FILLER 							PIC X(57).
			05 FILLER 								PIC X(29).