by Tim » Thu Mar 24, 2011 10:10 pm
I apologize for my imprecise terminology. It seems I'm unable to adequately express the problem. Let me try a different approach. My company has a mainframe (we call it the "host"). Around 2:00am it runs scheduled jobs that ftp files in both directions between the host and various other systems. Occasionally these jobs fail because of transient network problems. When that happens, an error code appears on the operator console next to the job (the code is 166, meaning the ftp destination is unreachable). At the same time, an error is automatically logged in the issue tracking system, and that triggers an email to the unlucky soul who's carrying the Blackberry that night. The operator will rerun the job a few minutes later and it will almost invariably succeed. My goal is to alter the job somehow so that it automatically retries the ftp a couple times, and only then if it hasn't succeeded will it alert the operator, automatically log the issue, and drag someone out of bed.
This is a big company, and different groups own different parts of the overall system. The part my group can access is shown below. It consists of a job and a proc (sorry if my terminology is still wrong here). In particular, we don't own ftpproc--we can use it, but we can't change it. If it completes successfully, RC is 0, and it it fails, RC is 166.
My idea was to check RC after the ftpproc executed and retry if it failed. In fact, that part works. We can force a failure at PS0020 (by simply deleting the file target before the job starts), then allow the the second step to succeed (by recreating the file while the job is sleeping before the retry). All seems good, except when the job is finished 166 still appears on the operator console, and the email still goes out.
If this still doesn't make sense, I guess I'll guess I'll have give up and just live with it.
Thanks for taking the time to help!
//NBAM029D JOB 15541840NM,'PJMESS FILE PULL',
// MSGCLASS=P,CLASS=N
//*
//*-------------------------------------------------------------------*
//* THIS JOB PULLS THE PJ ITEM MESSAGE *
//* FILES FROM EACH STORE. *
//*-------------------------------------------------------------------*
//*
//JOBLIB DD DSN=NM.FIX.BATCH.LOADLIB,DISP=SHR
// DD DSN=NM.PROD.BATCH.LOADLIB,DISP=SHR
//*
//UCC11RMS EXEC PROC=UCC11RMS,TYPRUN='P'
//*
//*-------------------------------------------------------------------*
//* RESTART PROCEDURES FOR STEP: JS0010 *
//* RESTART AT : JS0010 *
//* THIS STEP PULLS THE PJ ITEM FILE MESSAGE *
//*-------------------------------------------------------------------*
//JS0010 EXEC NBAP6004,
// NTFILE=POS29-1,
// CONTROL1='NBAPM029',
// STR='029'
//*
//*-------------------------------------------------------------------*
//* RESTART PROCEDURES FOR STEP: JS0020 *
//* RESTART AT : JS0020 *
//* THIS STEP SENDS A FLAG ALERTING NEW POS THAT FILES HAVE BEEN *
//* PULLED SO THAT THE ARCHIVING PROCESS CAN BEGIN. *
//*-------------------------------------------------------------------*
//JS0020 EXEC NBAP6008,
// NTFILE=POS29-1,
// CONTROL1='NBAPFLAG'
//*
//*--------------------------------------------------------------------*
//*- E N D O F J O B N B A M 0 2 9 D -*
//*--------------------------------------------------------------------*
//*-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
//*- P R O C N B A P 6 0 0 4 -*
//*-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
//*-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
//*- SYSTEM: POS HOST -*
//*- TITLE: POS PJITEM UPLOAD -*
//*- FREQUENCY: DAILY -*
//*- DESCRIPTION: THIS JOB IS RUN TO UPLOAD THE PJITEM MESSAGE -*
//*- FILE TO THE HOST EACH DAY. -*
//*-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
//*- -- MODIFICATION LOG -- -*
//*-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
//*- DATE : 06/26/05 -*
//*- PROGRAMMER : NMJP1 -*
//*- MODIFICATION : CREATED -*
//*-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
//*- DATE : 05/21/10 -*
//*- PROGRAMMER : NMJP1 -*
//*- MODIFICATION : ADDED RESTART INSTRUCTIONS FOR FTP ISSUES -*
//*-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
//*-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
//*- -- RESTART INSTRUCTIONS -- -*
//*-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
//* PROC STEP PS0010: RESTART AT PS0010
//* PROC STEP PS0020: RESTART AT PS0020
//* **NOTE** THIS JOB CAN BE STARTED FROM THE TOP
//* THIS JOB:
//* 1). CREATES AN EMPTY UPLOAD FILE.
//* 2). PULLS THE PJMESS FILE FROM THE WINDOWS BOX TO THE HOST
//* A) IF THIS JOB ABENDS, RESTART THE JOB AT LEAST THREE TIMES.
//* B) IF IT FAILS ON A CONNECTION ERROR, CALL THE NETWORK GROUP OR
//* FIND OUT IF THE SERVER IS DOWN. IF THE SERVER IS DOWN,
//* RERUN THE JOB ONCE THE SERVER IS BACK ONLINE.
//* C) IF A AND B DO NOT RESOLVE THE ISSUE, CALL THE APPLICATIONS TEAM
//*-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
//*
//NBAP6004 PROC OMODE=P,
// CLIB='PROD',
// CONTROL1=XXXX,
// NTFILE='POSXX-X',
// STR='999'
//*
//*--------------------------------------------------------------------*
//IF10 IF (RC=0) THEN
//PS0010 EXEC PGM=IEBGENER
//*--------------------------------------------------------------------*
//*- STEP FUNCTION: -*
//*- -*
//*- GENER EMPTY UPLOAD FILE -*
//*- RESTARTABLE IN THIS STEP -*
//*--------------------------------------------------------------------*
//*
//SYSUT1 DD DUMMY,
// DCB=(N.MODEL,RECFM=FB,LRECL=81,BLKSIZE=0)
//*
//SYSUT2 DD DSN=NMBA.&OMODE..N.TR.UPLD.DAILY.PJMESS.ST&STR,
// DISP=(NEW,CATLG,DELETE),
// DCB=(N.MODEL,RECFM=FB,LRECL=81,BLKSIZE=0),
// SPACE=(CYL,(1,1),RLSE)
//*
//SYSIN DD DUMMY
//*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSOUD DD SYSOUT=*
//SYSABOUT DD SYSOUT=*
//*
//ENDIF10 ENDIF
//*-------------------------------------------------------------------
//IF20 IF (RC=0) THEN
//PS0020 EXEC FTPPROC
//*-----------------------------------------------------------------*
//*- STEP FUNCTION: -
//* FTP PJITEM MESSAGE FILE FROM NT MACHINE TO HOST
//*- -
//*- RESTART IN THIS STEP IF THE FILE IS NOT FOUND -
//*-------------------------------------------------------------------
//*
//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
//*-------------------------------------------------------------------
//*- E N D O F P R O C N B A P 6 0 0 4 -*
//*-------------------------------------------------------------------