I'm trying to modify an existing proc that performs an ftp from a mainframe to a Wintel box. The original JCL (from the point of interest) looks like this:
//IF20 IF (RC=0) THEN
//PS0020 EXEC FTPPROC
//INPUT DD DSN=OPCPROD.NETRC.WFTPPROD.FTP,DISP=SHR
// DD DSN=OPCPROD.NETRC.&NTFILE..FTP,DISP=SHR
// DD DSN=NM.&CLIB..CNTLIB(&CONTROL1),DISP=SHR
////ENDIF20 ENDIF
The job fails occasionally, due to transisent network problems. It doesn't retry. My proposed modification is this:
//IF20 IF (RC=0) THEN
//PS0020 EXEC FTPPROC
//INPUT DD DSN=OPCPROD.NETRC.WFTPPROD.FTP,DISP=SHR
// DD DSN=OPCPROD.NETRC.&NTFILE..FTP,DISP=SHR
// DD DSN=NM.&CLIB..CNTLIB(&CONTROL1),DISP=SHR
//*
//* ---First retry
//IF21 IF (PS0020.RC NE 0) THEN
// EXEC PGM=BPXBATCH,PARM='SH sleep 150'
//PS0021 EXEC FTPPROC
//INPUT DD DSN=*.PS0020.INPUT
//*
//* ---Second retry
//IF22 IF (PS0021.RC NE 0) THEN
// EXEC PGM=BPXBATCH,PARM='SH sleep 150'
//PS0022 EXEC FTPPROC
//INPUT DD DSN=*.PS0020.INPUT
//*
//ENDIF22 ENDIF
//ENDIF21 ENDIF
//ENDIF20 ENDIF
This more or less works, but the problem is that if any step produces a non-zero RC, the entire job still abends, which kind of defeats the whole purpose. Is there a way to produce a 0 RC as long as one of the retries succeeds, or is there a better approach?
Thanks!