Page 1 of 1

To call a step again

PostPosted: Tue Oct 30, 2012 3:15 pm
by deva_048
Proc1 contains so many steps. Among that one step name is step1.

My Question is:

If step1 rc equal to 8
need to call step 1 again.

Note: Proc1 contains more than one steps. I need to call the particular step name along with proc.

Thanks in Advance.

Re: To call a step again

PostPosted: Tue Oct 30, 2012 3:26 pm
by BillyBoyo
You can't "call" a step, whether again or just once.

Steps are executed serially, with no possibility of loops, calls, or anything.

Why would the step do something different when executed again?

Re: To call a step again

PostPosted: Tue Oct 30, 2012 3:36 pm
by Robert Sample
As BillyBoyo said, what you want to do cannot be done -- PERIOD.

You will need to re-think the design and come up with something viable.

Re: To call a step again

PostPosted: Tue Oct 30, 2012 3:37 pm
by deva_048
My scenario here is FTP fails with return code 8. we need to restart it from same ftp step to complete the job.

Any other possible ways to do this in JCL?

Re: To call a step again

PostPosted: Tue Oct 30, 2012 3:46 pm
by BillyBoyo
I'd be looking to do all the FTP-related stuff in a separate job, and let the Scheduler work things out. I'd also be researching how many, many other places deal with what might be the same problem (since you haven't said what the "8" represents) when they successfully automate their ftp processes which are tossing files to-and-fro across the planet.

Re: To call a step again

PostPosted: Tue Oct 30, 2012 4:10 pm
by deva_048
Here is the jcl below:

//FTP2 EXEC PGM=FTP,PARM='(EXIT=8'                                 
//SYSIN    DD DSN=&SYS..PDS(file1),DISP=SHR                       
//         DD DSN=&PREF..AAA.txt,DISP=SHR                         
//         DD DSN=&SYS..PDS(file2),DISP=SHR                       
//SYSPRINT DD SYSOUT=$                                                 
//SYSOUT   DD SYSOUT=$                                                 
//**********************************************************************
//* IF .TXT IS NOT FTPED THEN SEND EMAIL notification             
//* AND ABEND THE JOB                                                   
//   IF ( FTP2.RC EQ 8 ) THEN                                       
//**********************************************************************
//EMAIL2 EXEC PGM=IKJEFT1B,DYNAMNBR=50                               
//SYSEXEC  DD DISP=SHR,DSN=CNM.P.XMITIP.EXEC                           
//SYSPRINT DD SYSOUT=$                                                 
//SYSTSPRT DD SYSOUT=$                                                 
//SYSTSIN  DD DSN=&SYS..PDS(file3),DISP=SHR                       
//ABENDST  EXEC PGM=TSS21200


file1: server info will be there
file 2: quit
AAA.txt contains GET a.data 'USERNAME.BBBB.TXT' (replace
file 3: Mail details

FTP error:
EZA2589E Connection to server interrupted or timed out. Receiving data
EZA2590E recv error from receive_data - EDC5120I INTERRUPTED FUNCTION CALL. (errno2=0x76650291)
EZA1475I Connection with ftp01.oracle.com terminated
EZA2607W Transfer aborted due to receive error (-2)
EZA1735I Std Return Code = 16150, Error Code = 00010

Whenever it fails we are restarting the job from failed step i.e) FTP2 step. Is there any other possibilities to do change in jcl to call the step again to complete the job.

Re: To call a step again

PostPosted: Tue Oct 30, 2012 4:26 pm
by Robert Sample
Is there any other possibilities to do change in jcl to call the step again to complete the job.
NO!

Let me make this as clear as I can -- JCL cannot loop; it cannot redo steps; it cannot repeat steps. Furthermore, once the JCL has gone through the JES converter / interpreter after being submitted, it cannot be changed in any way, period. As you have been REPEATEDLY told -- you have a flawed design if you expect to be able to change your JCL.

MOST sites, when confronted with the issue you have, use their job scheduler (CA-7, ZEKE, TWS, or whatever) to check the return code of the job and submit a second job (or allow the same job to be submitted again). This is because the original job can only be restarted -- it cannot be changed to run the step again, it cannot be made to loop, it has executed the FTP step and gotten the failure and your choices are limited -- use condition code checking later in the same job to do something, or use your scheduler to detect a problem has occurred, or manually review the job every time it runs.

Re: To call a step again

PostPosted: Tue Oct 30, 2012 9:27 pm
by Ed Goodman
Just to be a smart ass, you could always code a new step that is exactly like the first one. Then conditionally execute it if the prior step has a problem. This is very bad design, but at least it's an option.

Now of course, we'll learn that OP is not able to CHANGE the proc, they just run it. So the next question will be how to insert a step into an existing proc from JCL.

Re: To call a step again

PostPosted: Tue Oct 30, 2012 11:48 pm
by dick scherrer
Hello,

Not exactly in direct line with the dialog here, buy why is it acceptable that there are errors that the "solution" is to just try it again. . . We only run a few hundred ftp's a day (pushing and pulling data) and if something fails, it gets investigated - not retried. If it fails at 10:01:13, it will probably fail again at 10:01:15 . . .

As has been suggested, i too recommend that this be a separate job. Then you/your organization need to decide how to properly proceed. Rather common is sending an "alert" so those responsible are aware and correct the problem or request the restart. Have the remainder of the process be dependent on the ftp completing successfully.