IBM Version 4 Universal Remote User Manual


 
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