I have a COBOL program that calls the next program in a series of programs (in house transactional system). It calls a program using this syntax:
CALL NEXT-PROG USING blah blah blah
NEXT-PROG is the next program in the series.
most of the time this works great. We have this in a RUNUNIT, so we isolate what is being run. However, we recently ran into a problem. The program being called had the headers mixed up. It's an abort routine, and it should only be called if another program error-ed out. This program wasn't being executed, although it compiled. During our conversion process this program had a copybook put in front of the PROGRAM-ID, forcing the system to not recoginze it. First lines looked like this:
$SET CHECKNUM
REPOSITORY.
COPY CONNECTIONCLASSESREPOSITORY.
IDENTIFICATION DIVISION.
PROGRAM-ID. TPR365S-017.
The call is executed, but the return value is always 0, even when the program isn't recognized, and no code is executed.
Is there something I can do, or a directive to set, to get an error when the program doesn't exist, is improper, or otherwise won't execute? Right now the program acts like it executed normally, return-code is 0.




