ETOPLOAD program ends with RC=0 although an error was detected - EZOPT012 Line has extra data for example.
Non-zero return code would help the user to intercept processing prior to executing subsequent steps to review the errors.
Until messages not issuing a non-zero return code can be reworked, the following sample may be used as a workaround:
In the ETOPLOAD step code a SYSOUT DD statement as shown below:
//SYSOUT DD DSN=&&ERRORS, // DISP=(,PASS), // UNIT=3390,SPACE=(TRK,(1,1)) ==> Do not code DCB parm <==
Then add the step as shown below immediately following the ETOPLOAD step:
//CHKERROR EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //INFILE DD DSN=*.ETOPLOAD.SYSOUT,DISP=(OLD,DELETE) //OUTFILE DD SYSOUT=* //SYSIN DD * REPRO INFILE(INFILE) OUTFILE(OUTFILE) IF MAXCC EQ 0 THEN - SET MAXCC = 8 IF MAXCC EQ 12 THEN - SET MAXCC = 0 /*
In case no errors were detected, IDCAMS REPRO will end with RC=12 which is then set to 0, please expect to see the following message in your joblog:
This is seen due to missing or improper DCB info as this was not given before.
In case errors were detected, default DCB information will be used for SYSOUT.
Remarks: This workaround also works if ETOPLOAD detected errors and ended with RC=8
The above is only a suggestion, other utility program or self written program may be used instead.