beautypg.com

HP NonStop G-Series User Manual

Page 110

background image

Defining Custom Counters

Measure User’s Guide 520560-003

5- 14

Sample COBOL Application

IF fstat-1 NOT = 0
* I.E. RECORD NOT FOUND
MOVE "*** CUSTOMER NOT FOUND ON FILE ***"
TO REPLY-MSG OF SEC-NAR-REPLY
MOVE 0 TO REPLY-CODE OF SEC-NAR-REPLY
WRITE SEC-NAR-REPLY
PERFORM MEAS-INCUST
GO TO F-99.
* I.E. RECORD FOUND
IF PIN-NO OF MESSAGE-FILE = PIN-NO OF PIN-RECORD
MOVE "*** VERIFICATION COMPLETED ***"
TO REPLY-MSG OF SEC-NAR-REPLY
MOVE 0 TO REPLY-CODE OF SEC-NAR-REPLY
WRITE SEC-NAR-REPLY
PERFORM MEAS-SUC
ELSE
MOVE "*** INVALID PIN NUMBER ***"
TO REPLY-MSG OF SEC-NAR-REPLY
MOVE 0 TO REPLY-CODE OF SEC-NAR-REPLY
WRITE SEC-NAR-REPLY
PERFORM MEAS-INP.
*
*
F-99.
PERFORM MEAS-RB.

F-EXIT.
EXIT.

/
*
MEAS-NUMS SECTION.
*
* Pinched from MEASSRC
* Measure control

MEAS-SB.
* setbusy (3) for Measure control

ENTER TAL "MEAS^BUMP" USING WS-BUSY-NAME, MEAS-SETBUSY
GIVING MEAS-ERROR.

MEAS-RB.
* resetbusy (4) for Measure control

ENTER TAL "MEAS^BUMP" USING WS-BUSY-NAME, MEAS-RESETBUSY
GIVING MEAS-ERROR.

MEAS-INCUST.
* user-created counter for INVALID CUSTOMER ID

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

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