4. Declare an exception handler for MCH1202. With this exception description, all
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 identifier
string 1202 where 12 = X'0C' and 02 = X'02'. While most MCH
errors follow this relationship of message ID string to hexadecimal
EXCID, you should always refer to the

Machine Interface Functional

Reference
to determine what specific exception IDs may be signaled by
a given MI statement.
5. Because label M1202 is being used to indicate an error, set the return code to
1 by 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 “Handling
Exceptions in the MICRTPG2 Program” on page 7-27.
6. Because the non-M1202 path indicates that no error was detected, update the
normal return path:
RETURN: CPYBLA RC,'ð';
7. Because M1202 was appended to the end of the MI01 source, remove the ori-
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-10 System API Programming V4R1