Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need to auto restart a job

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Fri Nov 09, 2007 5:47 pm    Post subject: Need to auto restart a job
Reply with quote

Hi All,

I have a requirement for restarting a job automatically when it abends. The job is abending only in the FTP step while placing the connection to a server. Please help me with code to auto restart a job. The requirement says that they don't need any fixes from the server side.
So the solution should be like if the job abends at the FTP step with return code 12 then the rexx should be invoked and try restarting the job form the FTP step. When it successful the REXX step should be ommitted.

Amar.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Nov 09, 2007 6:40 pm    Post subject: Reply to: Need to auto restart a job
Reply with quote

the simplest and most effective solution ( NO CODING ) would be to use
any scheduler facilities..
split the job in three jobs...
put a serial dependency on them,
instruct the scheduler to keep executing the ftp ( the second one) job until success
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Fri Nov 09, 2007 6:45 pm    Post subject:
Reply with quote

Thanks for your reply.

In fact I am trying to give a automated solution and we want the solution should be in coding formt which will be innovative if its coding to have an auto restart . So I need the coding way only.

Please

Thanks once again
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Nov 09, 2007 6:55 pm    Post subject: Reply to: Need to auto restart a job
Reply with quote

Quote:
solution should be in coding formt which will be innovative if its coding


I disagree on the business effectiveness of writing code ( any type ) for this kind of task...

using a scheduler would be by any mean the most general approach
able to cope with any level of sophistication in your restart policy,
including the cleanup steps before a restart

If You / Your_organization have already made a choice it means that
every side of it has been evaluated, included the skills needed to carry on the choice taken...

If You need help on the coding, it means that somebody has taken the wrong decision
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Fri Nov 09, 2007 7:01 pm    Post subject:
Reply with quote

They didnt ask for me to code to have an auto restart.
Look,
I will explain it simply. The job is abending in FTP step. Then we will go and restart that job from the abended step. It will go fine. So it creating lot of abends even say 4 abends in 24HRs. So to reduce it it has been assigned as a quality process and been assigned to application team who ever is supporting the job. So to have a slick solution it should be an auto restart which will not involve any body at anyc ost.

Regards
Amar
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Fri Nov 09, 2007 7:23 pm    Post subject:
Reply with quote

Ok

I accept your words. But let it client's choice. Of course its always you know. Please leave about that and suggest me if you have coded previously these things. I am asking because I am very very new to REXX. Frankly I don't know abcd's of REXX. But I have very very small programs like doing a sum of 2 numbers and displaying using a "SAY".

So please let the discussion to move in coding way.

Thanks
Amar
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Fri Nov 09, 2007 9:49 pm    Post subject:
Reply with quote

It would be a good idea to put the FTP in a job by its self. Check to see if your scheduling package could resubmit the job if it ends with a bad return code. If the scheduling package can not do this, put a step in the FTP job JCL that will run only if the bad condition code is received (cond code checking), that will copy the JCL to the internal reader (ie. resubmit the job automatically). No REXX or other programming required, just JCL changes. In this shop they do not like this sort of thing but our scheduling package takes care of most of this type of thing.
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Fri Nov 09, 2007 9:56 pm    Post subject:
Reply with quote

That's Good Idea!!!

But can you explain bit detail with code if possible. Because I am not fully aware of internal reader.

Regards
Amar
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Fri Nov 09, 2007 10:14 pm    Post subject: Reply to: Need to auto restart a job
Reply with quote

My experience with FTP has proven that it's best to run the FTP process from inside a control application where you can add program and logic control over the process. I think it helps to have a process where you can check for connection failures, take steps to restart the connection, and perform pre- and post- transfer file directory listings, all without having to have a job failure, at least until a pre-determined failure threshold has been reached.
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Fri Nov 09, 2007 10:35 pm    Post subject:
Reply with quote

Code:

//**                               
//        IF STEP10.FTP.RC GT 0 THEN
//**                               
//STEP20  EXEC PGM=ICEGENER                       
//SYSUT1   DD  DSN=HLQ...JCLLIB(JOBNAME),DISP=SHR
//SYSUT2   DD  SYSOUT=(A,INTRDR),DCB=BLKSIZE=80     
//SYSIN    DD  DUMMY                               
//SYSPRINT DD  SYSOUT=*                             
//**                               
//**             
//          ENDIF
//**             
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Sat Nov 10, 2007 2:42 pm    Post subject: Reply to: Need to auto restart a job
Reply with quote

Hi,
the one problem I see with resubmitting the FTP step in the event of a failure without a scheduling package is that you will need some smarts to stop the job from running after a number of attempts else you could end up in a loop if FTP continues to fail.


Gerry
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Sat Nov 10, 2007 4:08 pm    Post subject:
Reply with quote

I'll go with superk - process the FTP within a REXX or something with monitoring.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun Nov 11, 2007 2:42 am    Post subject:
Reply with quote

Hello,

And within that rexx, set a limit on how many times the attempt will be made. Be kinda ugly if the "next" run comes along while "this" run is still not done. . .
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Mon Nov 12, 2007 1:24 pm    Post subject:
Reply with quote

Thank you all,

As gcicchet said if say the server is down then the job will continuously makes attempts to restart the job, instead it would be great if we have some number of times as limit. Can any one please help me on that.

Regards
Amar
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Mon Nov 12, 2007 1:42 pm    Post subject:
Reply with quote

One more thing its not resubmitting I need to restart the job from the abended step. The step is around 6th or 7th step. So how can we do that if I use internal reader
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Nov 12, 2007 1:45 pm    Post subject: Reply to: Need to auto restart a job
Reply with quote

Just a question...

Are You trying to "GET" a dataset or to "PUT" ..
from/to this unreliable FTP site ??

If You are trying to "PUT" there is no reason to have the request syncronous
with Your JOB;

If You are trying to "GET" the dataset, the most effective way,
both from a resource consumption and human time to "CODE" point of view

would be to put the burden of FTP transmission on the other side
and use the scheduler facilities to start the JOB execution only when the
needed dataset has been successfully stored.

It is still a BAD scheduling practice to start executing a Job when
all the needed resources are not available.

You might use rexx to issue the FTP command,
in the same script You migh loop "N" times, but still You would need
some scheduler action to resubmit the job/part_of_it to complete the process.


the general flow of the rexx could be ...


Code:
do n_times
    /* prepare the FTP commands */
    QUEUE "OPEN your_dest"
    QUEUE "USER Your_user"
    .... all the other commands needed to get/put the dataset
    .... You could find out by running a TSP ftp session to find out
    QUEUE ""
    FTP
    if RC = 0 then return 0
    ... find a way of sleeping for some time
    ... no use to have a strict loop
end

return any_return code to indicate failure



in case of failure use the scheduler
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Mon Nov 12, 2007 3:02 pm    Post subject:
Reply with quote

Yes it is 'PUT' and it is executing to 'PUT' commands in the same single connection.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Nov 12, 2007 3:20 pm    Post subject: Reply to: Need to auto restart a job
Reply with quote

Quote:
Yes it is 'PUT' and it is executing to 'PUT' commands in the same single connection.


since it is just a put why complicate your life for no reason..
the proc flow is confusing...

why force an ftp_put dependency on subsequent steps of a procedure ??
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Mon Nov 12, 2007 4:24 pm    Post subject:
Reply with quote

Even if it is just a 'PUT' we need to have the connection till the put operation completes successfully right?

here that is what is not happening(not always) say as I said in my previous discussion its abending for 4 times a day out of it will have runs say for every 30 minutes in 24 hours of a day.

now you might have got how severe the job is?

So the problem is when ever it abends an automatic will create a ticket and we will restart the job and it goes fine. So to stop abending a job I need an auto restart.

And its not a small system that a schedluer can monitor this job alone and can restart when ever it abends.

Its a dump and there will be hundreds of jobs running a day. So client is maintaining a huge team for only restarts and cancellation all CA-7 Handlings in another country.

Now I guess you have got an idea of the process. So instead of abending let's restart the job when it abends after sleeping for some 2 minutes and attempt the same for 3 itmes and lets abend the job at that time only when it abends for the third time.

That is what is the requirement. Please try to follow up the discussion and the requirement is like Quality if we achieve it make it ready for the client.


Why we need to think of changing the requirement it self? Let that be auto restart

Regards
Amar
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Query related to inserting an auto po... Gopalakrishnan V DB2 4 Fri Dec 18, 2015 12:09 am
No new posts SEQNUM and RESTART zh_lad DFSORT/ICETOOL 2 Tue Aug 25, 2015 8:17 pm
No new posts Restart Logic suraaj DB2 5 Fri Feb 27, 2015 8:47 pm
No new posts Auto Job dependency Drawing tool for OPC airan002 IBM Tools 1 Sat Aug 16, 2014 1:17 am
No new posts Question on JCL Restart trushant.w Mainframe Interview Questions 18 Mon Feb 24, 2014 6:49 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us