DCL PTR INV_PTR2 DEF(RTNTMPLT) POS(1);

DCL DD \ CHAR(1) DEF(RTNTMPLT) POS(17) INIT(X'ðð');

DCL DD ACTION CHAR(2) DEF(RTNTMPLT) POS(18);

DCL SPCPTR RTNTMPLT@ INIT(RTNTMPLT);

4.Retrieve the exception data associated with the MCH1401 exception

RETEXCPD EXCPDBUF@, X'ð1';

5. Compare the exception data object identifier to the space identif If they are the same, branch to label SAME:

CMPBLA(B) EXC_OBJ, OBJID / EQ(SAME);

a. If the exception data object identifier and the space ident same, the program is truly in an unexpected error condition and tion description needs to be disabled:

MODEXCPD DUPERROR, X'2ððð', X'ð1';

Retry the failing instruction. As the exception description is di

exception

is sent to the caller of

the program:

 

 

 

 

CPYBLA ACTION, X'ðððð';

 

 

 

 

 

 

B E14ð1;

 

 

 

 

b. If

the

exception data object identifier and

the

space

ident

the static storage must have been effectively

reset. The

progra

USRSPC@

by

using the returned system

pointer in

the

exception dat

continues

with the next instruction following the

failed CRTS:

 

SAME:

CPYBWP USRSPC@, EXC_OBJ@;

 

 

 

 

 

 

CPYBLA ACTION, X'ð1ðð';

 

 

 

 

E14ð1: CPYBWP INV_PTR2, INV_PTR;

 

 

 

 

 

 

RTNEXCP RTNTMPLT@;

 

 

 

 

 

 

PEND;

 

 

 

 

MICRTPG2

Complete Program

(Enhanced)—MI

Code

Example

In its

consolidated

state,

this

is the new MICRTPG2 program:

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\

 

\/

/\

Program Name: MICRTPG2

\/

/\

 

\/

/\

Programming Language: MI

\/

/\

 

\/

/\

Description: Enhanced version of MI program MICRTPG2,

\/

/\

which provides for exception handling.

\/

/\

 

\/

/\

 

\/

/\

Header Files Included: None

\/

/\

 

\/

/\

 

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\ Entry point and associated parameters

\/

ENTRY \ (\ENTRY) EXT;

 

DCL SPCPTR FIL@ PARM;

 

DCL SPCPTR MBR@ PARM;

 

DCL OL \ENTRY (MBR@, FIL@) PARM EXT MIN(1);

 

DCL DD FIL CHAR(1ð) BAS(FIL@);

 

7-28System API Programming V4R1

Page 168
Image 168
IBM Version 4 manual Example, Its Consolidated State This Is the new MICRTPG2 program