4.Declare an exception handler for MCH1202. With this exception descr occurrences of MCH1202 will cause an immediate (IMD) branch to label M1202.

DCL

EXCM

 

DATAERROR EXCID(H'ðCð2') BP (M12ð2) IMD;

 

 

 

Note:

The

EXCID

is

the hexadecimal representation of the message id

 

string

1202

where '0C12'

=andX

02 '02= '.X While most

MCH

 

 

 

errors

follow

this relationship of message ID

string

to

hexade

 

EXCID, you should always referMachineto theInterface Functional

 

 

Referenceto

determine

what

specific exception

IDs

may

be si

 

a

given MI

statement.

 

 

 

 

 

5. Because label M1202 is being used to indicate an error, set the

1by using copy bytes left-justified and then end:

M12ð2: CPYBLA

RC,'1';

RTX

\;

PEND;

 

A more complete example of how to handle exceptions is provided in Exceptions in the MICRTPG2 Program” on page 7-27.

6.Because the non-M1202 path indicates that no error was detected, normal return path:

RETURN: CPYBLA

RC,'ð';

7. Because

M1202

was appended to the end of the MI01 source, remov

ginal MI01

PEND

directive.

The following is an updated view of the MI01 program:

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

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

/\

 

\/

/\

Program Name: MIð1

\/

/\

 

\/

/\

Programming Language: MI

\/

/\

 

\/

/\

Description: Enhanced version of MI program MIð1 that

\/

/\

demonstrates enabling an exception monitor.

\/

/\

 

\/

/\

Header Files Included: None

\/

/\

 

\/

/\

 

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ ENTRY \ (PARM_LIST) EXT;

DCL

SPCPTR

ARG1@

PARM;

 

DCL

SPCPTR

ARG2@

PARM;

 

DCL

SPCPTR

RESULT@

PARM;

 

DCL

SPCPTR

RC@

PARM;

 

DCL

OL

PARM_LIST

 

 

 

 

(ARG1@,

 

 

 

 

ARG2@,

 

 

 

 

RESULT@,

 

 

 

 

RC@)

 

 

 

 

PARM

EXT;

 

DCL

DD

ARG1

PKD(15,5)

BAS(ARG1@);

DCL

DD

ARG2

PKD(15,5)

BAS(ARG2@);

DCL

DD

RESULT

PKD(15,5)

BAS(RESULT@);

7-10System API Programming V4R1

Page 150
Image 150
IBM Version 4 Excid, Hexadecimal representation of the message id, String 1202 Where 0C12 =andX 02 02= .X While most, Mch