View previous topic :: View next topic
|
Author |
Message |
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
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 |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
Back to top |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
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 |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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... |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 . . . |
|
Back to top |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Then why are you asking about 2 running concurrently? |
|
Back to top |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Peter cobolskolan
Active User
Joined: 06 Feb 2012 Posts: 104 Location: Sweden
|
|
|
|
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 |
|
|
|