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

JCL to submit 3 jobs one after another


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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 03, 2010 4:03 am
Reply with quote

Manish,

would you have the jcl for the TMP step, please.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Thu Jun 03, 2010 4:45 am
Reply with quote

Dick's question is the only question that should be answered now.

Please do so.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Thu Jun 03, 2010 6:14 am
Reply with quote

personally I prefer having one run class unique and only associated with a single initiator. That way serial processing is assured.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Jun 03, 2010 12:53 pm
Reply with quote

Hi Dave,

what happens when a job fails, how do you prevent others from running ?

Gerry
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 03, 2010 1:28 pm
Reply with quote

Still if u need 3 separate jobs instead of 1,
Another crude approach can be,

having a IKJEFT01 step at the end of the first job with COND=(4,LT) or some other COND to check if the job ran successfully and make it execute the tso command
Code:
SUB 'YOUR.PDS.WHICH.HAS.THE.NEXTJOB'



This step will trigger next job, if the triggering job completes successfully.

Hope it helps,
Back to top
View user's profile Send private message
Manish Kumar Gupta

New User


Joined: 19 Feb 2008
Posts: 6
Location: Bangalore

PostPosted: Thu Jun 03, 2010 3:35 pm
Reply with quote

You can code the IKJEFT1B step like this.

Code:
//STEPXX   EXEC PGM=IKJEFT1B,COND=(0,NE)               
//SYSPRINT DD   SYSOUT=*                               
//SYSOUT   DD   SYSOUT=*                               
//SYSTSPRT DD   SYSOUT=*                               
//SYSTSIN  DD   *                                     
   SUBMIT 'YOURPDSNAME(MEMNAME)'                 
/*                                                     
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Thu Jun 03, 2010 3:47 pm
Reply with quote

Gerry,

First and foremost, Scheduler is best overall choice.


I've seen shops where each pgm calls subpgm prior to successful ending and posts status in a file. Subsequent pgms called common pgm to see if prev pgm was successful. File is usually VSAM and contains running order of jobs/pgms by name -- "the in-house scheduler approach"


My point was serialization, but I overlooked failure. Good catch?
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 03, 2010 3:51 pm
Reply with quote

If serialisation is required, then why restrict the initiator to 1? run all jobs at one go with same job name.. they will execute one by one.. icon_smile.gif
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Thu Jun 03, 2010 3:55 pm
Reply with quote

Using same name may be okay in test, but unacceptable in production.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Jun 03, 2010 6:26 pm
Reply with quote

dneufarth wrote:
Using same name may be okay in test, but unacceptable in production.


Not if you have the right agreements with production and/or some
friends there. At least that is my experience.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 03, 2010 6:39 pm
Reply with quote

I have worked at shops (where in the non-prod environment)
where more than 2 submitted jobs under the same name (or user id) will cause the the 3rd and subsequent to fail.


in other words, only 2 jobs max at a time in job queue.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Thu Jun 03, 2010 6:41 pm
Reply with quote

Peter,

I agree, but in all shops I've worked Prod Job names had to be unique. All were under control of a Scheduler or may have triggers based on Job names submitted via CICS region (these were also unique). Those CICS submitted jobs not under Scheduler usually created GDG datasets.

Shop standards obviously vary.

I just happened to be the QA guy and involved with stds.

Everyone can 'boo' now!
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Jun 03, 2010 6:49 pm
Reply with quote

Well Dave im not boo'ing you. QA people like you deserve a place too icon_smile.gif

I could do those things because of my "support" work.
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 03, 2010 8:52 pm
Reply with quote

Hello,

I suppose i am really slow this week. . .

So far i have seen no reason that this is more than a single job with multiple steps. . .

From a scheduling perspective, one job is trivial (i.e. without convolutions) to handle as a "single process". Restart/rerun is simplified in a single job. From a quality control or maintenance perspective, maintaining one job should be easier/cleaner than 3. What business reason (that someone "said so" is not a business reason) to inplement 3 jobs?

As i said - i'm slow this week, but i still do not understand . . .
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Jun 03, 2010 9:29 pm
Reply with quote

madhu2010 wrote:
First job's output file feeding to Second job, Second Job Output is input to 3rd job.
...
Also please let me know how it works with 1 job and 3 Execs.

I think Madhu has nothing against 1 job with 3 steps,
maybe he is just lacking some basic knowledge...

Also, using one job allows the use of temporary files.
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 03, 2010 9:38 pm
Reply with quote

Hi Marso,

Quote:
I think Madhu has nothing against 1 job with 3 steps,
maybe he is just lacking some basic knowledge...
Possibly. . .

Madhu,
If you are not familiar with multi-step jobs, you might look at the jcl that is submitted when you compile/link a program.

If there are questions, post them here and someone will be able to clarify.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Thu Jun 03, 2010 11:44 pm
Reply with quote

I was just suplementing one part of OP request for multiple jobs.

Single job may be okay and seems very applicable here unless it runs for hours and hours and involves update of VSAM datasets. Restart is not as simple in that circumstance.

We had std avoiding RESTART and limiting jobs to 45 mins or thereabouts. Few had knowledge of internal reader.

Much came about from a VM/VSE shop moving to MVS in LPARS. PROCS were shunned initially -- compexity with abend diagnosis for those new to expanding procs. Some standards were relaxed over time as knowledge increased.

Just a note: our stds worked very well and a monthly stds meeting for adds/mods/deletes aided that tremendously. It's amazing how quickly the programmers adapted and wanted more leeway, but accepted limitation/conformity stds. Naming conventions rolled right into the as/400 world when we ventured there -- even into the PC/server world.
Programmers moved to various areas were immediately comfortable and just dealt with platform specific. I digress; sorry.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Jun 04, 2010 3:50 am
Reply with quote

OK, 37 posts in this topic, only 6 by to OP and he seems to have quit the topic over 2 days ago......Enough?
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Fri Jun 04, 2010 5:13 am
Reply with quote

William,

why the cut-off? I thought the point was discussion. Is it because the topic isn't being absolutely followed or something else?

Regards,
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: Fri Jun 04, 2010 6:13 am
Reply with quote

Hi Bill,

Quote:
he seems to have quit the topic over 2 days ago......
Just watching rather than posting. . .

Personally, i enjoy these discussions when everyone plays nice icon_smile.gif

And if the view-count can be believed, more than just a few are following the discussion. . . icon_wink.gif

d
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri Jun 04, 2010 6:25 am
Reply with quote

Maybe he's thinking about the old phrase of 'flogging a dead horse'.....grin....
The way I think he sees it is if the OP abandons the thread, we should too.
dneufarth wrote:
I thought the point was discussion.
How about we start up topics such as "Discussion: Is one job better than three?"
Back to top
View user's profile Send private message
toughhou

New User


Joined: 21 Jan 2010
Posts: 5
Location: China

PostPosted: Mon Nov 12, 2012 6:59 pm
Reply with quote

Here I have two ways:
1. Using 3 steps
//JOB001 JOB MSGCLASS=A,NOTIFI=&SYSUID
//STEP01 EXEC PGM=PGM01
//FILEIN1 DSN=TOUGH.TEST.FILE.IN1,DISP=SHR
//FILEOUT1 DSN=TOUGH.TEST.FILE.OUT1,DISP=.....
//STEP02 EXEC PGM=PGM02
//FILEIN2 DSN=STEP01.FILEOUT1,DISP=SHR
//FILEOUT2 DSN=TOUGH.TEST.FILE.OUT2,DISP=....
//STEP03 EXEC PGM=PGM03
//FILEIN3 DSN=STEP02.FILEOUT2,DISP=SHR
//FILEOUT3 DSN=TOUGH.TEST.FILE.OUT3,DISP=....

2. Using 3 jobs
JCL1:
//JOB0001 JOB .....
//STEP01 EXEC PGM=PGM01
//FILEIN1 DSN=TOUGH.TEST.FILE.IN1,DISP=SHR
//FILEOUT1 DSN=TOUGH.TEST.FILE.OUT1.DISP=....
//STEP02 EXEC PGM=IKJETF01
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
SUBMIT TOUGH.TEST.JCL(JCL2)
//

JCL2:
//JOB0001 JOB .....
//STEP01 EXEC PGM=PGM02
//FILEIN2 DSN=TOUGH.TEST.FILE.OUT1,DISP=SHR
//FILEOUT2 DSN=TOUGH.TEST.FILE.OUT2.DISP=....
//STEP02 EXEC PGM=IKJETF01
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
SUBMIT TOUGH.TEST.JCL(JCL3)
//

JCL3:
//JOB0001 JOB .....
//STEP01 EXEC PGM=PGM01
//FILEIN3 DSN=TOUGH.TEST.FILE.OUT2,DISP=SHR
//FILEOUT3 DSN=TOUGH.TEST.FILE.OUT3.DISP=....

Thank you for the contribution, but it is best to reply to topics that are currently active.
Also, when postng JCL, code, data etc use the Code tag for alignment and readability. Simply copy/paste from your mainframe screen and do Not try to adjust the spacing. d
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


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

PostPosted: Mon Nov 12, 2012 7:06 pm
Reply with quote

I think he found a solution over 2 years ago.
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 Finding and researching jobs All Other Mainframe Topics 0
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts Help in Automating Batch JCL jobs mon... JCL & VSAM 3
No new posts Submit multiple jobs from a library t... JCL & VSAM 14
No new posts Ca7 long running jobs report All Other Mainframe Topics 1
Search our Forums:

Back to Top