IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Run the job using Internal Reader


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sanupadh

New User


Joined: 29 Jun 2010
Posts: 11
Location: chennai

PostPosted: Thu Jun 16, 2011 2:48 pm
Reply with quote

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
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Thu Jun 16, 2011 2:52 pm
Reply with quote

What if the job A never runs successfully? icon_biggrin.gif
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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Jun 16, 2011 2:55 pm
Reply with quote

What is wrong with your scheduling system?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jun 16, 2011 3:02 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Jun 16, 2011 6:15 pm
Reply with quote

Are you talking aout a real, a production, a practical requiremnet?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Jun 16, 2011 8:14 pm
Reply with quote

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
View user's profile Send private message
sanupadh

New User


Joined: 29 Jun 2010
Posts: 11
Location: chennai

PostPosted: Fri Jun 17, 2011 11:06 am
Reply with quote

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
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Fri Jun 17, 2011 11:34 am
Reply with quote

How would the second job 'B' kick off if the job A has abended?
Back to top
View user's profile Send private message
sanupadh

New User


Joined: 29 Jun 2010
Posts: 11
Location: chennai

PostPosted: Fri Jun 17, 2011 11:51 am
Reply with quote

we will sheduled the job B to run after A everyday.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Fri Jun 17, 2011 11:57 am
Reply with quote

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
View user's profile Send private message
sanupadh

New User


Joined: 29 Jun 2010
Posts: 11
Location: chennai

PostPosted: Fri Jun 17, 2011 12:02 pm
Reply with quote

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
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Fri Jun 17, 2011 12:15 pm
Reply with quote

No that is fine... But Job B will have a dependency in the scheduler.
Back to top
View user's profile Send private message
sanupadh

New User


Joined: 29 Jun 2010
Posts: 11
Location: chennai

PostPosted: Fri Jun 17, 2011 12:43 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Jun 17, 2011 12:52 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Jun 17, 2011 1:57 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Jun 17, 2011 2:13 pm
Reply with quote

Anuj, shame on you for suggesting the logical approach icon_biggrin.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Jun 17, 2011 2:24 pm
Reply with quote

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... icon_neutral.gif.

No offences meant, just an effect of another book I was reading these days...
Back to top
View user's profile Send private message
sanupadh

New User


Joined: 29 Jun 2010
Posts: 11
Location: chennai

PostPosted: Fri Jun 17, 2011 2:25 pm
Reply with quote

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
View user's profile Send private message
sanupadh

New User


Joined: 29 Jun 2010
Posts: 11
Location: chennai

PostPosted: Fri Jun 17, 2011 2:34 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Jun 17, 2011 2:35 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Jun 17, 2011 2:48 pm
Reply with quote

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
View user's profile Send private message
sanupadh

New User


Joined: 29 Jun 2010
Posts: 11
Location: chennai

PostPosted: Fri Jun 17, 2011 2:55 pm
Reply with quote

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
View user's profile Send private message
sanupadh

New User


Joined: 29 Jun 2010
Posts: 11
Location: chennai

PostPosted: Fri Jun 17, 2011 3:00 pm
Reply with quote

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
View user's profile Send private message
sanupadh

New User


Joined: 29 Jun 2010
Posts: 11
Location: chennai

PostPosted: Fri Jun 17, 2011 3:02 pm
Reply with quote

Please dont confuse with return code 08.Its OK
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Jun 17, 2011 3:07 pm
Reply with quote

Show us, what is there in: FVTEST.W.ADCXZNK.CARDLIB(DUMMY)?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Search substring in internal table of... COBOL Programming 2
This topic is locked: you cannot edit posts or make replies. Internal Autonomous Stored Procedure ... DB2 6
No new posts Getting error S000 U0016 (Cn Internal... JCL & VSAM 4
No new posts "Output" internal table (OD... COBOL Programming 0
No new posts Trying to submit COBOL PGM - JCL ERRO... JCL & VSAM 5
Search our Forums:

Back to Top