C\ exception does occur.

 

C\

 

 

 

C

 

IF

QUSBAVL > ð

C

 

OPEN

QPRINT

C

 

EXCEPT

ERRAEPGM

C

 

EXSR

DONE

C

 

ENDIF

 

C

 

EXSR

DONE

C\

 

 

 

C\ End of MAINLINE

 

 

C\

 

 

 

C\

 

 

 

C\ Return to programs caller

 

C

DONE

BEGSR

 

C

 

EVAL

\INLR = '1'

C

 

RETURN

 

C

 

ENDSR

 

C\

C\ Calculate 4-byte aligned offset for next variable lengt￿h record

C\

 

 

 

 

 

 

C

CALC_VOFF

BEGSR

 

 

C

 

 

EVAL

BINARY = QUSLD + 12

C

 

 

DIV

4

 

BINARY

C

 

 

MVR

 

 

BINARY

C

 

 

IF

BINARY = ð

 

C

 

 

EVAL

QUSLVRðð = (QUSLD + 12)

C

 

 

ELSE

 

 

 

C

 

 

EVAL

QUSLVRðð = (QUSLD + 12 + (4 - BINARY))

C

 

 

END

 

 

 

C

 

 

EVAL

%SUBST(RECS:V_OFFSET:12) = QUSVR4

C

 

 

EVAL

V_OFFSET = V_OFFSET + QUSLVRðð

C

 

 

ENDSR

 

 

O\

 

 

 

 

 

 

OQPRINT

E

 

ERRAEPNT

1

6

O

 

 

 

 

 

'Attempt to register exit -

O

 

 

 

 

 

point failed: '

O

 

 

 

QUSEI

 

 

OQPRINT

E

 

ERRAEPGM

1

6

O

 

 

 

 

 

'Attempt to add exit -

O

 

 

 

 

 

program failed: '

O

 

 

 

QUSEI

 

 

Retrieve Exit Point and

Exit Program

Information—OPM COBOL

Example

 

 

Refer

to “Retrieve

Exit Point and Exit Program Information—ILE C Example

page 4-13 for the original example.

IDENTIFICATION DIVISION.

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\

\ Program: Retrieve Exit Point and Exit Program Information

\

\Language: OPM COBOL

\Description: This program retrieves exit point and exit

\

program information. After retrieving the

Appendix B. Original Examples in Additional BLanguages-61

Page 339
Image 339
IBM Version 4 manual Information-OPM Cobol