DCL DD RESULT PKD(15,5) BAS(RESULT@);
BRK "ðððð1";
CMPNV(B) ARG1,ARG2 / LO(ITS2);
CPYNV RESULT,ARG1;
B RETURN;
ITS2: CPYNV RESULT,ARG2;
BRK "ðððð2";
RETURN: RTX \;
PEND;
This allows the HLL programmer to use the following to debug the HLL program by
using the statement identifiers of the HLL:
STRDBG PGM(HLLEXAMPLE)
ADDBKP STMT(ðððð2) PGMVAR((RESULT ()))
The following display shows that the HLL statement 00002 has been equated with
MI instruction 0005 due to the use of BRK directives:
à ð
Display Breakpoint
Statement/Instruction . . . . . . . . . : ðððð2 /ððð5
Program . . . . . . . . . . . . . . . . : HLLEXAMPLE
Recursion level . . . . . . . . . . . . : 1
Start position . . . . . . . . . . . . : 1
Format ................:\CHAR
Length ................:\DCL
Variable ...............:RESULT
Type . . . . . . . . . . . . . . . . : PACKED
Length . . . . . . . . . . . . . . . : 15 5
' 6.ððððð'
Handling Exceptions in the MI Program
As coded, the MI01 program works fine when it is passed packed decimal parame-
ters. But when the MI01 program is passed other data types, such as in CALL
CL01 (abc 6), exceptions occur. To handle these exceptions, additional state-
ments could be added to MI01 so that:
A 1-character return code parameter returns a status where ð indicates no
error and 1 indicates an error occurred.
An exception description is defined to handle MCH1202 decimal data errors.
Add the following statements to MI01:
1. Declare a fourth space parameter to receive the return code parameter:
DCL SPCPTR RC@ PARM;
2. Update the operand list directive for PARM_LIST:
DCL OL PARM_LIST
(ARG1@,
ARG2@,
RESULT@,
RC@) /\ the new parameter \/
PARM EXT;
3. Declare the storage addressed by RC@ as a 1-byte character data element:
DCL DD RC CHAR(1) BAS(RC@);
Chapter 7. Machine Interface Programming 7-9