MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Submitting jobs dynamically

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
Abhi
Beginner


Joined: 03 Dec 2002
Posts: 21
Topics: 4
Location: India, Pune

PostPosted: Fri Jan 09, 2004 1:36 am    Post subject: Submitting jobs dynamically Reply with quote

I am trying to set up a utility that will submit jobs in a sequence dynamically to JES. The strategy that I have adopted is -

- I have put all the jobs that I need to submit in one PDS.

- I have a VSAM file with a 8 byte jobname (PDS member name) field as the key and the data area is an array with a list of jobs that need to be triggered once this job (as in the key) gets completed successfully.

- I have coded a proc which has a program and an IDCAMS step. I have added this proc to the end of all jobs in my PDS and this proc receives a parameter i.e. the jobname (PDS membername) which is calling it.

- The program receives this parameter passed to the proc, looks up the VSAM file and creates a REPRO card in the following format and passes it to the next IDCAMS step.
Code:
 REPRO     -                                       
INDATASET ('MY.JOB.PDS(TRIGNAME1)') -
OUTFILE   (OUTDD1)                               

REPRO     -                                       
INDATASET ('MY.JOB.PDS(TRIGNAME2)') -
OUTFILE   (OUTDD1)                               


- The IDCAMS uses this card to submit the job to INTRDR.


Now, the problem I am facing is that the first job gets submitted successfully but when IDCAMS tries to REPRO the second job to INTRDR it fails with an error -
Code:
 IKJ56225I DATA SET MY.JOB.PDS ALREADY IN USE, TRY LATER
IKJ56225I DATA SET IS ALLOCATED TO ANOTHER JOB OR USER


Is there a way to get around this error? I don't think IEBGENER or IEBCOPY can be used for my purpose. I will be grateful for any pointers. I can take it up from there.
Back to top
View user's profile Send private message Send e-mail
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Fri Jan 09, 2004 7:08 am    Post subject: Reply with quote

A quick solution would be to submit an Idcams step for each repro, that should solve your problem.
Back to top
View user's profile Send private message Visit poster's website
RobertL
Beginner


Joined: 18 Nov 2003
Posts: 22
Topics: 0
Location: Lisbon, Portugal

PostPosted: Fri Jan 09, 2004 8:35 am    Post subject: Reply with quote

Hi,
As warp5 said, you should probably submit the IDCAMS JCL as a separate job, but the it should specify the name of the JCL member in a DD statement instead of in the INDATASET parm as shown below. Using INDATASET requires exclusive access to the referenced dataset (why, I don't know. Maybe to ensure the integrity of backups). Using a DD statement and INFILE gets around this issue.

Hope this helps.
Regards,
Robert

Code:
//SUBMIT   EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//INDD1    DD DSN=MY.JOB.PDS(TRIGNAME1),DISP=SHR
//INDD2    DD DSN=MY.JOB.PDS(TRIGNAME2),DISP=SHR
//OUTDD1   DD SYSOUT=(A,INTRDR)
//SYSIN    DD *
REPRO INFILE (INDD1) OUTFILE (OUTDD1)
REPRO INFILE (INDD2) OUTFILE (OUTDD1)
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Jan 09, 2004 9:10 am    Post subject: Reply with quote

Abhi,

I would use IKJEFT01 for submitting the jobs.with IDCAMS repro you are copying the jobs once again. You can avoid the copy step by using the SUBMIT command with IKJEFT01

Code:

//STEP0010 EXEC PGM=IKJEFT01           
//SYSUDUMP DD SYSOUT=*                 
//SYSTSPRT DD SYSOUT=*                 
//SYSOUT   DD SYSOUT=*                 
//SYSTSIN  DD *                         
SUB 'MY.JOB.PDS(TRIGNAME1)'     
SUB 'MY.JOB.PDS(TRIGNAME2)'     
SUB 'MY.JOB.PDS(TRIGNAME3)'     
....
/* 


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Abhi
Beginner


Joined: 03 Dec 2002
Posts: 21
Topics: 4
Location: India, Pune

PostPosted: Fri Jan 09, 2004 9:27 am    Post subject: Reply with quote

Thank u Kolusu, IKJEFT01 looks like the best option.

Robert, Warp, I can not use multiple IDCAMS step because at any point of time I wouldn't be able to determine how many jobs need to be submitted.
Back to top
View user's profile Send private message Send e-mail
tejnp
Beginner


Joined: 26 May 2005
Posts: 1
Topics: 0
Location: Noida, India

PostPosted: Thu May 26, 2005 11:55 pm    Post subject: Reply with quote

Abhi wrote:
Thank u Kolusu, IKJEFT01 looks like the best option.

Robert, Warp, I can not use multiple IDCAMS step because at any point of time I wouldn't be able to determine how many jobs need to be submitted.
I have a question:
would the jobs
'MY.JOB.PDS(TRIGNAME1)'
'MY.JOB.PDS(TRIGNAME2)'
'MY.JOB.PDS(TRIGNAME3)'
run in sequence or can run parallel? I want them to run in sequence... meaning next runs only if current is over.
_________________
Regards,
Tej
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri May 27, 2005 7:20 am    Post subject: Reply with quote

Tejnp,

If you want to run the jobs in sequence then have the submit of job trigname2 in trigname1 as last step.

ex: trigname1 job.
Code:

//TRGNAME1 JOB
//STEP1    EXEC PGM=...
//STEP2    EXEC PGM=...
...
//LASTSTEP EXEC PGM=IKJEFT01           
//SYSUDUMP DD SYSOUT=*                 
//SYSTSPRT DD SYSOUT=*                 
//SYSOUT   DD SYSOUT=*                 
//SYSTSIN  DD *                         
SUB 'MY.JOB.PDS(TRIGNAME2)'   
/*


similarly code for other jobs also.

Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
saro
Beginner


Joined: 20 Aug 2005
Posts: 11
Topics: 1
Location: chennai

PostPosted: Sat Aug 20, 2005 5:40 am    Post subject: Reply with quote

Hi Kolusu,

Iam new to this group.
this is my first post.
my question is related to this topic only.submitting job thro another job.

1)I want to submit a series of jobs which i would like to submit directly from Panvalet and not from PDS.is it possible ?

and if so

2) i have a schedule(the sequence in which i have to execute).how to acheive running the jobs in the same sequence.

3) and if at all any jobs abend or if i want to stop the chain in midway how do i do it.


Kindly answer
Thanks
_________________
Saro

Nothing is great unless God.
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Sat Aug 20, 2005 9:35 am    Post subject: Reply with quote

saro,
Your requirements are more suited for already commercially available softwares called job schedulers. You are trying to re-invent the wheel. Of course, I do not know the complete background of your problem. Nevertheless, a job scheduler is what you are really looking for.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Sun Aug 21, 2005 2:40 am    Post subject: Reply with quote

Quote:

)I want to submit a series of jobs which i would like to submit directly from Panvalet and not from PDS.is it possible ?

saro,

If your JCL are in Panvalet library you can use the example posted by me in the post just above your question.

Quote:

2) i have a schedule(the sequence in which i have to execute).how to acheive running the jobs in the same sequence.


Well as cogito mentioned a Job scheduler (ca-7 , control-m , zeke...) is what you need. If you don't have a scheduler then you can simply add a step in jcl to submit the next job.

Ex: if you have 4 jobs namely JOb1, JOb2, Job3, Job4 and you want to run them in the ascending sequence. Add a step in the end to JOB1 which will submit JOb2 and similarly add a step in JOB2 which will submit JOB3 and so on.

Quote:

3) and if at all any jobs abend or if i want to stop the chain in midway how do i do it.


If you follow my above suggestion , your chain will stop at the abending job itself

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
saro
Beginner


Joined: 20 Aug 2005
Posts: 11
Topics: 1
Location: chennai

PostPosted: Sun Aug 21, 2005 8:55 pm    Post subject: Reply with quote

Cogito and kolusu,

As u said my requirement was more or less a scheduler only.but we are not previlleged use CA7 for testing jobs.it could be used only for production jobs in our project.


my problem is, i have 190 jobs to test,for which i know the flow and the test job
setup is ready.what i expected is to modify your post according to my requirement,

//LASTSTEP EXEC PGM=IKJEFT01
//SYSUDUMP DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSTSIN DD *
SUB 'MY.JOB.PDS(TRIGNAME2)'
/*

in such a way to submit the flow in one strike.sit and watch.. Smile
and Kolusu,i didnt want to include this utility in each job to trigger the next coz these are gonna be reviewed by clients(to match exactly the production jobs).

Anyways Thanks for your response.
_________________
Saro

Nothing is great unless God.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon Aug 22, 2005 3:44 am    Post subject: Reply with quote

Quote:

in such a way to submit the flow in one strike.sit and watch..
and Kolusu,i didnt want to include this utility in each job to trigger the next coz these are gonna be reviewed by clients(to match exactly the production jobs).


Saro,

With the restrictions you have I cannot think of a way to get around.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
saro
Beginner


Joined: 20 Aug 2005
Posts: 11
Topics: 1
Location: chennai

PostPosted: Mon Aug 22, 2005 3:52 am    Post subject: Reply with quote

Thats fine kolusu,
i just wanted to know if any kind of automation is possible.
i'll try to do it in someway and let you know.but your post with IKJEFT01
was really helpfull in carrying out atleast 80 jobs .

Thanks for your efforts.
_________________
Saro

Nothing is great unless God.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group