Measure User's Guide
Defining Custom Counters
Measure User’s Guide—520560-003
5-10
Sample COBOL Application
The MEAS-NUMS section of the program contains the code to initialize and modify the 
counters; for example:
where:
action 
is an item from WS-MEASURE-LITS.
count 
is WS-id-COUNT (required only if action is MEAS-ADD).
index 
is a numeric value or WORKING-STORAGE entry that contains the index value for 
an array of counters.
MEAS^BUMP determines the counter’s offset with the Measure internal user-defined 
record and updates the counter values.
The returned value is not tested because the application program does not depend on 
the Measure subsystem and usually is not required to report or recover from Measure 
subsystem errors. However, for debugging purposes, the error codes 3221 (invalid 
bump type) and 3222 (invalid index) might be useful. All possible return codes are 
listed in $SYSTEM.SYSnn.MEASDECS.
ENTER TAL "MEAS^BUMP" USING WS-id-NAME,action,count,index
 GIVING MEAS-ERROR
Example 5-3. COBOL Application Containing User-Defined 
Counters (page1of6)
?SEARCH MEASLIB, $SYSTEM.SYSTEM.COBOLLIB
?INSPECT
?SYMBOLS
*
 IDENTIFICATION DIVISION.
*
 PROGRAM-ID. MYSERVER.
 AUTHOR.
 DATE-WRITTEN. 29 OCTOBER 1987.
 DATE-COMPILED.
*
*
 ENVIRONMENT DIVISION.
*
CONFIGURATION SECTION.
 SOURCE-COMPUTER. TNSII.
 OBJECT-COMPUTER. TNSII.
*
 INPUT-OUTPUT SECTION.
*










