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

Submit multiple jobs from a library through a single job


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

New User


Joined: 05 Sep 2022
Posts: 15
Location: Brazil

PostPosted: Thu Jun 08, 2023 10:43 pm
Reply with quote

We are having problems with the scheduler and until the problem is solved, we need to manually schedule several jobs and all of them need to change the MSGCLASS parameter from D to H and add the USER=XXXX.

Also, the jobs need to run in sequence.

Is it possible to do that?

Thanks in advance.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 720
Location: Denmark

PostPosted: Fri Jun 09, 2023 12:47 pm
Reply with quote

Yow will need some program to modify the jobs. Are there a lot? Making them into ISPF skeletons might be a solution.
To have them run in sequence you can do
1. Submit job2 and onwards with TYPRUN=HOLD and add a step at the end of each job to issue a release command for the next in line.
2. JES2 job groups, see JES2 Execution Control Statements in the JCL reference manual (my recommendation).
Back to top
View user's profile Send private message
pepeo_2k3

New User


Joined: 04 Nov 2023
Posts: 6
Location: Azerbayjan

PostPosted: Sun Nov 12, 2023 2:14 pm
Reply with quote

By writing a REXX code, you can generate a mass of jobs with the same ID to serialize them to be run in sequence and set the desired values to your parameters as well ....
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 720
Location: Denmark

PostPosted: Sun Nov 12, 2023 2:57 pm
Reply with quote

"with the same ID to serialize them to be run in sequence"
Not neccessarily true, JES2 now allows for duplicate jobnames. and execution sequence is not guaranteed to be in submission sequence.
Back to top
View user's profile Send private message
pepeo_2k3

New User


Joined: 04 Nov 2023
Posts: 6
Location: Azerbayjan

PostPosted: Sun Nov 12, 2023 6:05 pm
Reply with quote

Quote:
Not neccessarily true, JES2 now allows for duplicate jobnames

You mean either using
Code:

dupl_job= delay

in JES2 parameters, it doesn't work? Since this parameter is in the JES2 level this may not be the choice.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 720
Location: Denmark

PostPosted: Sun Nov 12, 2023 7:31 pm
Reply with quote

Yes that works, but if you submit a bunch of jobs with the same jobname I would not rely on them being started in jobid sequence.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10877
Location: italy

PostPosted: Sun Nov 12, 2023 11:17 pm
Reply with quote

Quote:
Yes that works, but if you submit a bunch of jobs with the same jobname I would not rely on them being started in jobid sequence.


even submitting jobs with different names does not guarantee the execution sequence
( see the jes2 manuals for the number of converter tasks )
Back to top
View user's profile Send private message
dneufarth

Active User


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

PostPosted: Mon Nov 13, 2023 12:46 am
Reply with quote

Perhaps a serial batch initiator (unique job class) exists in your system.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 720
Location: Denmark

PostPosted: Mon Nov 13, 2023 1:40 am
Reply with quote

I can only, once more, recommend JES2 job groups.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10877
Location: italy

PostPosted: Mon Nov 13, 2023 1:53 am
Reply with quote

Quote:
Perhaps a serial batch initiator (unique job class) exists in your system.


nope ...

with multiple converters the sequence of execution depends ON THE COMPLEXITY
of the job

a one step job will be converted be ready for execution much faster than a multi step complicated job
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2569
Location: Silicon Valley

PostPosted: Mon Nov 13, 2023 3:11 am
Reply with quote

Maybe add a step at the end of each job to submit the next job in the sequence.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 720
Location: Denmark

PostPosted: Mon Nov 13, 2023 2:15 pm
Reply with quote

Pedros idea might be the simplest solution. For my suggestion 'Submit job2 and onwards with TYPRUN=HOLD and add a step at the end of each job to issue a release command for the next in line.' you can use REXX/SDSF to issue the release command:
Code:
 /* REXX */                                                   
 cc=isfcalls('ON')                                             
 arg isfprefix .  /* parameter = jobname */                   
 isfowner ='*'                                                 
 isffiltermode = 'AND'                                         
 isffilter     = 'STATUS EQ HOLD'                             
 Address SDSF "ISFEXEC ST"                                     
 if jname.0 =0 then do                                         
   say 'Job' isfprefix 'not found in hold q'                   
   exit 8                                                     
 end                                                           
 say left(jname.1,8) left(jobid.1,8) left(queue.1,10) status.1
 say '$AJ' jobid.1   
 Address SDSF "ISFSLASH'$AJ" substr(jobid.1,4) "'"                                           
 exit 0                                                       

The RELEASE command can be protected in a way which does not open all console commands for the job.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 720
Location: Denmark

PostPosted: Mon Nov 13, 2023 8:45 pm
Reply with quote

Just realized, the
Address SDSF "ISFSLASH'$AJ" substr(jobid.1,4) "'"
should really be
Address SDSF "ISFSLASH'$A"jobid.1"'"
as your jobid might not be in the form JOBxxxxx.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2569
Location: Silicon Valley

PostPosted: Tue Nov 14, 2023 11:12 am
Reply with quote

One of my patents was for a simple scheduler job. A rexx program that read a control file and submitted a list of jobs. It checked the jobs via SDSF rexx API and waited for each job to end with good return code before submitting the next job.

It worked well, but it takes two initiators.

update: actually, I wrote this before the existence of the SDSF rexx API. I used the SDSF batch interface and had so many problems that I was able to convince my colleagues at IBM to create the SDSF rexx API.
Back to top
View user's profile Send private message
Patrick Bacelar

New User


Joined: 05 Sep 2022
Posts: 15
Location: Brazil

PostPosted: Tue Nov 14, 2023 11:52 pm
Reply with quote

Thank you for the suggestions. Unfortunately, due to the limited time we had, everything was done manually. However, the information you provided will be useful in my studies. This will help me be better prepared for when this situation arises again. I am also enhancing my knowledge in REXX.
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 Using Multiple IFTHEN and WHEN condit... SYNCSORT 12
No new posts How to turn off 'ACTION' SDSF output ... TSO/ISPF 2
No new posts Finding and researching jobs All Other Mainframe Topics 0
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top