beautypg.com

HP NonStop G-Series User Manual

Page 108

background image

Defining Custom Counters

Measure User’s Guide 520560-003

5- 12

Sample COBOL Application

01 WS-MEASURE-LITS.
03 MEAS-INC PIC 9 VALUE 1.
03 MEAS-ADD PIC 9 VALUE 2.
03 MEAS-SETBUSY PIC 9 VALUE 3.
03 MEAS-RESETBUSY PIC 9 VALUE 4.
03 MEAS-INCQUEUE PIC 9 VALUE 5.
03 MEAS-DECQUEUE PIC 9 VALUE 6.
03 MEAS-ERROR PIC 9(4).
*
* WS-MEASURE-LITS - are numeric literals that signify
* the action required from MEAS^BUMP.
* The numeric literals are equivalent
* to those given in
* $SYSTEM.SYSnn.MEASDECS,
* for use by TAL programmers.
*
* MEAS-ERROR - is a numeric field required to store
* status information returned by the
* calls to MEAS^BUMP and
* MEAS^BUMP^INIT. The value is tested
* to determine whether the counter is
* under measurement.

01 WS-MEASURE-COUNTERS.

03 WS-COUNTS-NAME PIC X(16) VALUE "COUNTS".
03 WS-BUSY-NAME PIC X(16) VALUE "BUSY-ST".
03 WS-TOTAL-NAME PIC X(16) VALUE "TOT-CNT".
03 WS-MEAS-TOTAL-TRANS PIC 9(4) COMP VALUE 0.

*
* WS-id-NAME - is an alphanumeric literal that
* names the Measure counter and the
* literal; it appears in the generated
* report. The entry defines either a
* single counter or an array of counters.
* Specify the counter name in the same
* way for either case.

/
*
PROCEDURE DIVISION.
DECLARATIVES.
FILE-RECOVERY SECTION.
USE AFTER STANDARD EXCEPTION PROCEDURE ON MESSAGE-FILE
REPLY-FILE
PIN-FILE.

Example 5-3. COBOL Application Containing User-Defined
Counters
(page 3 of 6)