View previous topic :: View next topic
|
Author |
Message |
sanupadh
New User
Joined: 29 Jun 2010 Posts: 11 Location: chennai
|
|
|
|
Hi,
I have job 'A' which runs daily but sometimes abended.I need to create a job 'B' which run after the job 'A' and check if job 'A' get abended then restart it from a 5th step (step05) and also override some parameter of
job 'A'.
also repeate the process untill job 'A' run successfully.
:P |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
What if the job A never runs successfully?
or you accidentally make a mistake in JOB A step 5, like coding a invalid DSN name and go home for the day, then the internal reader would be like inception movie on ur mainframe, with several levels inside levels inside levels.. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
What is wrong with your scheduling system? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Can you please state, in as much detail as possible, and including the JCL for A in "code tags" (grey button that says Code), what your requirement is, rather than what you think is the solution to your requirement. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Are you talking aout a real, a production, a practical requiremnet? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
For someone to be able to help, you need to answer the questions asked and provide the requested JCL. |
|
Back to top |
|
|
sanupadh
New User
Joined: 29 Jun 2010 Posts: 11 Location: chennai
|
|
|
|
job 'A' run successfully but some times it abended due to specific abend
('U0617' IN STEP 'step5') we always have to monitor it manually and check if it is abended due to 'U0617' IN STEP 'step5'. then need to restart the job from step5 with GDG (0).
We do it manually everyday.
Now my requirement is to create a monitoring job 'B' that run after 'A'
and validates its spool file and do the above work automatically.
for this, below portion I have done.
1.copied spool file of job 'A' in PS file(let it A.spool) using SARBCH utility.
2.I am checking the file A.spool for the return code of job 'A' if it is '0' then send notification mail that job 'A' run successfully.
3.if not then checking if it is abend 'U0617' IN STEP 'step5' then restart the job 'A' using Internal reader.
below is the code
//STEP08 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=ojb.library(A),DISP=SHR
//SYSUT2 DD SYSOUT=(,INTRDR)
//SYSIN DD DUMMY
now problem is it start job from step 1 but I want to start it form step5
and also I want to change the GDG(+1) to GDG(0).
GDG(+1) using in job 'A'. |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
How would the second job 'B' kick off if the job A has abended? |
|
Back to top |
|
|
sanupadh
New User
Joined: 29 Jun 2010 Posts: 11 Location: chennai
|
|
|
|
we will sheduled the job B to run after A everyday. |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
sanupadh wrote: |
we will sheduled the job B to run after A everyday. |
But if the job A doesn't complete (Fails)... Then How the job B will run? |
|
Back to top |
|
|
sanupadh
New User
Joined: 29 Jun 2010 Posts: 11 Location: chennai
|
|
|
|
noproblem with this if it is completed or abended (fails) in both the cases
spool file will be created we have to check the spool file for jon 'A'
in case of abend job 'A' terminated with abend. |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
No that is fine... But Job B will have a dependency in the scheduler. |
|
Back to top |
|
|
sanupadh
New User
Joined: 29 Jun 2010 Posts: 11 Location: chennai
|
|
|
|
I dont know much about scheduler but we can schedule job 'B' to run after 'A' wheather 'A' completed or terminated.
or if it is not possible then we can manually run it after 'A'
in case of manual run it can also save our time.
because checking job 'A' manually we have to follow below steps.
check job 'A' in spool .
send mail if successfull.
restart it in case of abend,again send mail .
doing above we can directly run job 'B' it will handle it.
so my problem is not that how can I schedule it but how to create it.
thanks |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
why not use Your scheduler exception handling facilities ?
schedule job A
if everything is ok schedule the next normal job
if abend have the scheduler schedule the recovery job
if the recovery jobs succeeds schedule the next normal job
in case of error, then it is time for a manual intervention!
with a scheduler it is a bad practice to restart a job, even more in this case
where You have to skip some steps and change a dataset parameter,
a jcl restart needs a jcl change
it is better to plan in advance,
a proper scheduler setup will handle everything in a much smoother way!
for critical situations it is a normal practice to define/prepaer the related recovery jcls in order to avoid manual modifications to the original jcl |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
sanupadh wrote: |
job 'A' run successfully but some times it abended due to specific abend
('U0617' IN STEP 'step5') we always have to monitor it manually and check if it is abended due to 'U0617' IN STEP 'step5'. then need to restart the job from step5 with GDG (0). |
If you are so sure about the abend - why don't you work to take care about this abend itself at first place, so that it does not haapen next time? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Anuj, shame on you for suggesting the logical approach |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
LOL - actually, I had edited one more sentence for my previous reply, kinda awkward, however, I'll post it now:
PS. Is not it something like, I don't like it when my wife is angry so I look for another girl for that time; when She is normal, I get back to her... .
No offences meant, just an effect of another book I was reading these days... |
|
Back to top |
|
|
sanupadh
New User
Joined: 29 Jun 2010 Posts: 11 Location: chennai
|
|
|
|
Because it abends due to CICS.sometimes problem may happen in CICS region.we cant take care of that except resubmit the job |
|
Back to top |
|
|
sanupadh
New User
Joined: 29 Jun 2010 Posts: 11 Location: chennai
|
|
|
|
Abend is due to CICS region which can be down sometimes so we cant take care of that in the JOB 'A' itself.
I heard about IEBEDIT using it we can copy(submit) job to internal reader from perticular step.
but the again problem is how can I override GDG. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Suggest you tell us a little more about the situation at your end. Creating another Job which will look at the log file from abened or not-abended Job, does not really sound like a plan - just a patch to fix, which might blow at any time.
What would you do, if by some reason, your Job B also got failed someday? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Looks like you've edited your post about IEBEDIT.
Well, if you insist have a Job B:
As you said, if the job abends or not GDG is always calaloged anyways, when it reachs to you for a solution. Do the following:
- first step will take the GDG(0) to copy to a QSAM-file(flat file).
- copy step from your Job A as-it-is and make use of this QSAM file instead of GDG.
- In Job A have a step to submit above two steps using INTRDR (via Job B) only when there is an abend. |
|
Back to top |
|
|
sanupadh
New User
Joined: 29 Jun 2010 Posts: 11 Location: chennai
|
|
|
|
job B is nothing but a monitoring tool.
Below is my JCL.
Code: |
//*RETRIEVE THE JOB DETAILS FROM SAR (SPOOL) - FOR THE JOB ZFV1710
//********************************************************
//STEP02 EXEC PGM=SARBCH
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//OUTDS DD DSN=FVTEST.W.TRUST.ZFV1710.SPOOL,
// DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(50,10),RLSE),
// UNIT=SYSDA,
// LRECL=133,RECFM=FBA,BLKSIZE=27930
//SYSIN DD *
/DBASE NAME=VW.W.J.VWDBASE
/PRINT ID=ZFV1710 DDNAME=OUTDS
//***********************************************************
//*PICK RETURN CODE OF ALL STEPS
//****************************************************************
//STEP03 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=FVTEST.W.TRUST.ZFV1710.SPOOL,DISP=SHR
//SORTOUT DD DSN=FVTEST.W.TRUST.ZFV1710.ALLSTEPS.RCODE,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(90,100),RLSE),
// DCB=(LRECL=133,RECFM=FB)
//SYSIN DD *
INCLUDE COND=((27,10,CH,EQ,C'1I ZFV1710'),AND,(39,5,CH,NE,C'ENDED')
OUTREC FIELDS=(39,23,133:X)
SORT FIELDS=COPY,
STOPAFT=200
//***************************************************************
//*CREATE FILE BY VALIDATING RETURN CODE
//*OMITTING RETURN CODE '00','08','FLUSH'
//**************************************************************
//STEP04 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=FVTEST.W.TRUST.ZFV1710.ALLSTEPS.RCODE,DISP=SHR
//SORTOUT DD DSN=FVTEST.W.TRUST.ZFV1710.RCODE.ABEND,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(90,100),RLSE),
// DCB=(LRECL=133,RECFM=FB)
//SYSIN DD *
OMIT COND=((19,5,CH,EQ,C' 08'),OR,(19,5,CH,EQ,C' 00'),
OR,(19,5,CH,EQ,C'FLUSH'))
OUTREC FIELDS=(1,23,133:X)
SORT FIELDS=COPY
//****************************************************************
//*CHECKS FOR EMPTY DATASET CREATED IN STEP04
//****************************************************************
//CHKEMPT1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=D
//DFSMSG DD SYSOUT=D
//IN1 DD DSN=FVTEST.W.TRUST.ZFV1710.RCODE.ABEND,DISP=SHR
//TOOLIN DD *
COUNT FROM(IN1) EMPTY RC4
//*
//****************************************************************
//*SEND NOTIFICATION MAIL TO TRUST TEAM 'JOB RUN SUCCESSFULLY'
//****************************************************************
// IF (CHKEMPT1.RC EQ 4) THEN
//STEP05 EXEC SAS,OPTIONS='EMAILHOST=SMTP.BNYMELLON.NET'
//SYSTCPD DD DSN=FVTEST.W.ADCXZNK.CARDLIB(TCPDATA),DISP=SHR
//SAS.SYSIN DD DSN=FVTEST.W.ADCXZNK.CARDLIB(MAIL1),DISP=SHR
//******************************************************************
//*CREATE FILE IF ABEND 'U0617' IS IN STEP 'C5171035'
//******************************************************************
// ELSE
//STEP06 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=FVTEST.W.TRUST.ZFV1710.RCODE.ABEND,DISP=SHR
//SORTOUT DD DSN=FVTEST.W.TRUST.ZFV1710.ABEND.OUT,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(90,100),RLSE),
// DCB=(LRECL=133,RECFM=FB)
//SYSIN DD *
INCLUDE COND=((1,8,CH,EQ,C'C5171035'),AND,(19,5,CH,EQ,C'U0617'))
SORT FIELDS=COPY
//****************************************************************
//*CHECKS FOR EMPTY DATASET CREATED IN STEP06
//****************************************************************
//CHKEMPT2 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=D
//DFSMSG DD SYSOUT=D
//IN1 DD DSN=FVTEST.W.TRUST.ZFV1710.ABEND.OUT,DISP=SHR
//TOOLIN DD *
COUNT FROM(IN1) EMPTY RC4
//*
//****************************************************************
//*RERUN JOB ZFV1710 FROM STEP C5171035
//****************************************************************
// IF (CHKEMPT2.RC EQ 0) THEN
//STEP07 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=FVTEST.W.ADCXZNK.CARDLIB(DUMMY),DISP=SHR
//SYSUT2 DD SYSOUT=(,INTRDR)
//SYSIN DD DUMMY
//*
//****************************************************************
//*SEND NOTIFICATION MAIL TO TRUST TEAM 'OTHER ABEND'
//****************************************************************
// ELSE
//STEP08 EXEC SAS,OPTIONS='EMAILHOST=SMTP.BNYMELLON.NET'
//SYSTCPD DD DSN=FVTEST.W.ADCXZNK.CARDLIB(TCPDATA),DISP=SHR
//SAS.SYSIN DD DSN=FVTEST.W.ADCXZNK.CARDLIB(MAIL2),DISP=SHR
// ENDIF
// ENDIF |
Edited: Please use BBcode when You post some code/error, that's rather readable, Thanks... Anuj |
|
Back to top |
|
|
sanupadh
New User
Joined: 29 Jun 2010 Posts: 11 Location: chennai
|
|
|
|
problem is in STEP07 where now I am running a dummy jcl.
if abend occurs.
but I need to replace the dummy job by job ZFV1710 from step C5171035 with GDG(0)
how can I do this? |
|
Back to top |
|
|
sanupadh
New User
Joined: 29 Jun 2010 Posts: 11 Location: chennai
|
|
|
|
Please dont confuse with return code 08.Its OK |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Show us, what is there in: FVTEST.W.ADCXZNK.CARDLIB(DUMMY)? |
|
Back to top |
|
|
|