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
 

 

How to run two jobs with identical job name concurrently?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Wed Dec 04, 2013 2:24 pm    Post subject: How to run two jobs with identical job name concurrently?
Reply with quote

I have a requirement to run two jobs with identical job name concurrently, how can I achieve this?

My requirement is :
I have two steps in my job (except for the 1st step which determines which of the following two steps is to be executed), but only one step can be executed for each submition. As to which step will be executed, it is determined by some parameters in one of my table, I also have the logic to determine which step to execute in my first step.

Now , I want to execute the job while the same job for the last submition is not finished yet, that is , two submitted jobs with the same job names execute simutaleously.
how can achieve this?
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


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

PostPosted: Wed Dec 04, 2013 2:32 pm    Post subject:
Reply with quote

The way you describe it and the inference I get - the simple answer is no, you can not do it.

On the other hand, when you say - only one step should execute, for a given execution -- why not have two seprate Jobe altogether?
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Dec 04, 2013 2:52 pm    Post subject:
Reply with quote

Quote:
My requirement is :
I have two steps in my job (except for the 1st step which determines which of the following two steps is to be executed), but only one step can be executed for each submition. As to which step will be executed, it is determined by some parameters in one of my table, I also have the logic to determine which step to execute in my first step.


Just trying to understand are you trying to test something or is that the business case itself ?
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Wed Dec 04, 2013 3:28 pm    Post subject:
Reply with quote

Pandora-Box wrote:


Just trying to understand are you trying to test something or is that the business case itself ?

It's business case.
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: Wed Dec 04, 2013 3:30 pm    Post subject:
Reply with quote

It may be a business case, and it is certainly a NO WAY case too.

Can't be done. However, not sure if I'm totally off my rocker here but seem to recall two started tasks with the same name running together. But there again that might just be my memory playing tricks on me icon_rolleyes.gif
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Wed Dec 04, 2013 3:30 pm    Post subject:
Reply with quote

Anuj Dhawan wrote:
why not have two seprate Jobe altogether?


If I design it as two separate jobs, the quesition is :
How can I determine which one to execute at each time?

ONE and ONLY ONE step is to be executed in my job.
Back to top
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 175
Location: UK

PostPosted: Wed Dec 04, 2013 3:40 pm    Post subject:
Reply with quote

I believe it can be done, but only at a system level, you can't allow it just for specific jobs (although it can be limited to certain job classes).

Have a look at the DUPL_JOB parameter in the JES manual.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Dec 04, 2013 4:01 pm    Post subject: Reply to: How to run two jobs with identical job name concur
Reply with quote

Why don't you have three steps in a single JOB.

The first step decides which step needs to run amongst the other two (you need to know that somehow, anyway). Sets the CC, other two steps run/don't run depending on the CC via COND.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Wed Dec 04, 2013 6:18 pm    Post subject: Re: Reply to: How to run two jobs with identical job name co
Reply with quote

Bill Woodger wrote:
The first step decides which step needs to run amongst the other two (you need to know that somehow, anyway). Sets the CC, other two steps run/don't run depending on the CC via COND.
But I think the underlying question is -- can the "Job names be same"?

I've assumed that there can be two differnt "events" which will initiate the same Job for the given "instant" and the question is, as the "same job name" is already executing can the "same job name" again execute? Okay, I said that, but make some meaning out of it... icon_rolleyes.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Wed Dec 04, 2013 6:22 pm    Post subject:
Reply with quote

dejunzhu wrote:
Anuj Dhawan wrote:
why not have two seprate Jobe altogether?


If I design it as two separate jobs, the quesition is :
How can I determine which one to execute at each time?

ONE and ONLY ONE step is to be executed in my job.
1. If INTRDR is allowed - create two dummy steps, whcih will eventually submit "the steps you want" based on the CC. But that beats the purpose, they are again two different (differnt name) Jobs.

2. Have in total 3 Jobs - first a "dummy job" and two Jos with two different steps. First Job will read the "event" and sets the returen-code. based on which your scheduler can initiate one of the two jobs. Again it's not "same Job names".
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Wed Dec 04, 2013 6:26 pm    Post subject:
Reply with quote

From the JCL Reference manual:
Quote:
20.1.2 Name Field Code a jobname on every JOB statement, as follows:
Each jobname must be unique.
The jobname must begin in column 3.
The jobname is 1 through 8 alphanumeric or national ($, #, @) characters. If your system uses ANSI tapes, the jobname must contain only alphanumeric characters; it must not contain national ($, #, @) characters.
The first character must be alphabetic or national ($, #, @).
The jobname must be followed by at least one blank.
For the job types TSO logon and batch processing, the jobname must be unique, otherwise:
For TSO logon, duplicate jobnames fail. For example, if IBMUSER is logged on, another attempt to logon as IBMUSER will fail.
For batch processing, duplicate jobnames are delayed. For example, if job BATCH01 is executing, then another job named BATCH01 will be delayed until the original job has completed.
On a given system, only one job with a given name can be executing at any given time. If there are multiple systems, there can be multiple jobs executing with the same name -- one per system. However, the jobs cannot interact since they are running on different systems.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Wed Dec 04, 2013 7:21 pm    Post subject:
Reply with quote

There are some site-specific parameters that can impact job names and execution of jobs with the same name. The ONLY way to know for sure how your site is set up is to contact your site support group and discuss this issue with them. Asking on a forum such as this will give you answers, but those answers may be completely irrelevant to your site.
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: Wed Dec 04, 2013 7:55 pm    Post subject:
Reply with quote

Hello,

Quote:
I have a requirement to run two jobs with identical job name concurrently, how can I achieve this?
I do not believe this is the requirement . . .

Is there some reason you do not simply follow Bill's advice? One job with 3 steps - the first determining which step to "really" run and setting a condition code . . . icon_confused.gif
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Wed Dec 04, 2013 8:31 pm    Post subject: Re: Reply to: How to run two jobs with identical job name co
Reply with quote

Bill Woodger wrote:
Why don't you have three steps in a single JOB.

The first step decides which step needs to run amongst the other two (you need to know that somehow, anyway). Sets the CC, other two steps run/don't run depending on the CC via COND.

Sorry for my unclearly statement. But I DO have 3 steps exactly performs the same function as you mentioned .
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: Wed Dec 04, 2013 10:37 pm    Post subject:
Reply with quote

Hello,

Then why are you asking about 2 running concurrently?
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Thu Dec 05, 2013 8:29 am    Post subject:
Reply with quote

dick scherrer wrote:
Hello,

Then why are you asking about 2 running concurrently?

for instance,
day1, step1 is being executed, but before it's finished, step2 should be started;

day2, step2 is being executed, but before it's finished, step1 should be started;


as to whether step1 or step2 should be executed, it's determined by my first step (let's call it STEP0) in the SAME job.

If using the same job is impossible, is there an alternative?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Thu Dec 05, 2013 3:03 pm    Post subject:
Reply with quote

If step 2 is time dependent but and not dependent on step 1 then run it as another job - with a different jobname.
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: Thu Dec 05, 2013 7:34 pm    Post subject:
Reply with quote

Hello,

Quote:
for instance,
day1, step1 is being executed, but before it's finished, step2 should be started;

day2, step2 is being executed, but before it's finished, step1 should be started;

Bad idea . . . . Probably impossible to properly support even if it is implemented. Looks like a terrible thing to deal with when there are other problems . . .

Each time the job is run, the first program should decide which of the 2 should run. Period.

Much could depend on how the job is scheduled (i.e. what causes it to start?). Why can the job not run both steps when there is work for both?

You are makeing this far more difficult than it needs to be. . .
Back to top
View user's profile Send private message
Peter cobolskolan

Active User


Joined: 06 Feb 2012
Posts: 104
Location: Sweden

PostPosted: Fri Dec 06, 2013 1:58 pm    Post subject:
Reply with quote

You can,
but it depends on the setting in JESPARMxx parmlib-member.
The JOBDEF stmnt can specify DUPL_JOB=NODELAY, which enables jobs with the same name to be initiated. Specify DUPL_JOB=DELAY to prohibit this.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to show message using batch jobs madprasy TSO/ISPF 7 Fri Sep 09, 2016 6:55 pm
No new posts Don't allow CICS to submit batch jobs prino JCL & VSAM 5 Mon Jul 25, 2016 3:26 pm
No new posts Predicting jobs which are about to re... kpanchabhai85 DFSORT/ICETOOL 4 Thu Jun 30, 2016 7:51 pm
No new posts How to find jobs that are in schedule... anilkumar922 All Other Mainframe Topics 5 Tue Jun 28, 2016 10:01 am
This topic is locked: you cannot edit posts or make replies. Jobs At HCL Technologies - Weekend Dr... mjadwani2785 Mainframe Jobs 0 Thu Feb 18, 2016 8:31 pm


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