beautypg.com

HP NonStop G-Series User Manual

Page 111

background image

Defining Custom Counters

Measure User’s Guide 520560-003

5- 15

Sample COBOL Application

MEAS-INP.
* user-created counter for INVALID PASSWORD

ENTER TAL "MEAS^BUMP" USING WS-COUNTS-NAME, MEAS-INC,, 1
GIVING MEAS-ERROR.

MEAS-SUC.
* user-created counter for SUCCESSFUL PASSWORD

ENTER TAL "MEAS^BUMP" USING WS-COUNTS-NAME, MEAS-INC,, 2
GIVING MEAS-ERROR.

MEAS-CNT.
* user-created counter for NUMBER OF TOTAL TXNS

ENTER TAL "MEAS^BUMP" USING WS-TOTAL-NAME, MEAS-ADD,
WS-MEAS-TOTAL-TRANS
GIVING MEAS-ERROR.

MEAS-EXIT.
EXIT.

/
*
CLOSERS SECTION.
*
G-00.
*
* In this sample application, updating is done after each
* session to reduce overhead. Updating can be done after
* each transaction if necessary, but overhead is greater.
*
CLOSE MESSAGE-FILE REPLY-FILE PIN-FILE.

PERFORM MEAS-CNT.
PERFORM MEAS-RB.
*
G-99.
EXIT.

***********************************************************
* *
* E N D O F P R O G R A M *
* *
***********************************************************

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