To call a step again



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

To call a step again

Postby deva_048 » Tue Oct 30, 2012 3:15 pm

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.
deva_048
 
Posts: 72
Joined: Thu Feb 02, 2012 9:28 pm
Has thanked: 1 time
Been thanked: 0 time

Re: To call a step again

Postby BillyBoyo » Tue Oct 30, 2012 3:26 pm

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?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: To call a step again

Postby Robert Sample » Tue Oct 30, 2012 3:36 pm

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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: To call a step again

Postby deva_048 » Tue Oct 30, 2012 3:37 pm

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?
deva_048
 
Posts: 72
Joined: Thu Feb 02, 2012 9:28 pm
Has thanked: 1 time
Been thanked: 0 time

Re: To call a step again

Postby BillyBoyo » Tue Oct 30, 2012 3:46 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: To call a step again

Postby deva_048 » Tue Oct 30, 2012 4:10 pm

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.
deva_048
 
Posts: 72
Joined: Thu Feb 02, 2012 9:28 pm
Has thanked: 1 time
Been thanked: 0 time

Re: To call a step again

Postby Robert Sample » Tue Oct 30, 2012 4:26 pm

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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: To call a step again

Postby Ed Goodman » Tue Oct 30, 2012 9:27 pm

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.
Ed Goodman
 
Posts: 341
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times

Re: To call a step again

Postby dick scherrer » Tue Oct 30, 2012 11:48 pm

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post