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

How to run two jobs with identical job name concurrently?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Superior Member


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

PostPosted: Wed Dec 04, 2013 2:32 pm
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

Global Moderator


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

PostPosted: Wed Dec 04, 2013 2:52 pm
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
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: 8797
Location: Welsh Wales

PostPosted: Wed Dec 04, 2013 3:30 pm
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
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: 199
Location: UK

PostPosted: Wed Dec 04, 2013 3:40 pm
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

Moderator Emeritus


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

PostPosted: Wed Dec 04, 2013 4:01 pm
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

Superior Member


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

PostPosted: Wed Dec 04, 2013 6:18 pm
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

Superior Member


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

PostPosted: Wed Dec 04, 2013 6:22 pm
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Dec 04, 2013 6:26 pm
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Dec 04, 2013 7:21 pm
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

Moderator Emeritus


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

PostPosted: Wed Dec 04, 2013 7:55 pm
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
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

Moderator Emeritus


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

PostPosted: Wed Dec 04, 2013 10:37 pm
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
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: 2455
Location: Hampshire, UK

PostPosted: Thu Dec 05, 2013 3:03 pm
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

Moderator Emeritus


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

PostPosted: Thu Dec 05, 2013 7:34 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


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