If a return code of 0, 3, or 4 is an acceptable return code from the Program2 subroutine of the Program1 program, then you might specify the following functions:
CallProgRC=CallProg('Program1','Program2','COBOL','field1','field2')
Check(CallProgRC,'Error in Program2','NE',0,3,4)
If the return code from the Program2 subroutine is 1, processing fails and the following message is written to the log:
Error in Program2
If the return code from the Program2 subroutine is 0, processing continues and the specified message is not written to the log.