DCL DD RC CHAR(1) BAS(RC@);
DCL EXCM DATAERROR EXCID(H'C2') BP (M122) IMD;
CMPNV(B) ARG1,ARG2 / LO(ITS2);
CPYNV RESULT,ARG1;
B RETURN;
ITS2: CPYNV RESULT,ARG2;
RETURN: CPYBLA RC,'';
RTX ᑍ;
M122: CPYBLA RC,'1';
RTX ᑍ;
PEND;
The following example updates CL01 to support the new return code parameter:
/ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ/
/ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ/
/ᑍ ᑍ/
/ᑍ Program Name: CL1 ᑍ/
/ᑍ ᑍ/
/ᑍ Programming Language: CL ᑍ/
/ᑍ ᑍ/
/ᑍ Description: Enhanced version of CL program CL1 that ᑍ/
/ᑍ demonstrates the use of enhanced MI1. ᑍ/
/ᑍ ᑍ/
/ᑍ Header Files Included: None ᑍ/
/ᑍ ᑍ/
/ᑍ ᑍ/
/ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ/
PGM PARM(&ARG1 &ARG2)
DCL VAR(&ARG1) TYPE(ᑍDEC) LEN(15 5)
DCL VAR(&ARG2) TYPE(ᑍDEC) LEN(15 5)
DCL VAR(&RESULT) TYPE(ᑍDEC) LEN(15 5)
DCL VAR(&RC) TYPE(ᑍCHAR) LEN(1)
DCL VAR(&MSG) TYPE(ᑍCHAR) LEN(2)
DCL VAR(&USR) TYPE(ᑍCHAR) LEN(1)
RTVJOBA USER(&USR)
CALL PGM(MI1) PARM(&ARG1 &ARG2 &RESULT &RC)
IF COND(&RC = '') +
THEN(CHGVAR VAR(&MSG) VALUE(&RESULT))
ELSE +
CHGVAR VAR(&MSG) VALUE('ERROR FOUND')
SNDMSG MSG(&MSG) TOUSR(&USR)
ENDPGM
After recompiling the MI01 program and the CL01 program, CALL CL01 (abc 6)
now results in the following message (not the previous MCH1202):
ERROR FOUND
Creating an MI Version of CLCRTPG
The topics previous to this discuss how to create MI01 to be a reasonably complete
program. This topic discusses how to create an MI version of the CLCRTPG
program that can be used to create MI programs. This program is called
MICRTPG.
Chapter 7. Machine Interface Programming 7-11