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 

REXX Script to submit multiple Jobs when arguments are given
Goto page Previous  1, 2
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Jan 29, 2004 1:23 pm    Post subject: Reply with quote

Dibakar,

I don't think that there is a way to find which class is free. But there are ways to fool other jobs and let your jobs get executed first. One way to do is code a highest prty value on the Jobcard. The jobs with higher priority get execueted first. But if you start doing this quite often then your ID might get suspended for absuing the prty parameter.

Solution:2

Let us assume that you are allowed to run your jobs in 4 different classes namely A, B, C, D
Since you are dynamically generating the jobs, submit the first job to class A, second to class B , third to class C and the fourth to class D. Repeat the same process for all of your jobs. By doing so you are evenly splitting the jobs between classes.

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
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 702
Topics: 64
Location: USA

PostPosted: Fri Jan 30, 2004 2:32 am    Post subject: Reply with quote

Hi kolusu,

The solutions won't work as I need to execute the job in sequence. So whichever class I find free, I would submit all of them in the same class.

Maybe, as a test I could submit a small dummy job in all the classes to find which one started first and then use that class for others.

Thanks,
Diba.
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Jan 30, 2004 6:48 am    Post subject: Reply with quote

Dibakar,

Quote:

The solutions won't work as I need to execute the job in sequence


hmm in that case can't you just build one huge job with each step being a single job?

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


Joined: 02 Dec 2002
Posts: 702
Topics: 64
Location: USA

PostPosted: Wed Feb 25, 2004 8:03 am    Post subject: Reply with quote

Kolusu,

This solution won't work because these are mostly compile and link edit jobs so combining them will confuse user. Morover we have to save these jobs too.

Here's a primitive way of finding good class -

Code:

/* This REXX finds a good class to submit jobs                       
   Input : None                                                       
   Output: Job Class                                                 
*/                                                                   
 GOODCLASS:                                                           
 /* These are the classes I am authorised too */                       
 class.1 = 'C'; class.2 ='D';  class.3 = 'L'                         
 class_cnt = 3                                                       
                                                                     
 /* submit jobs with above classes */                                 
 do c = 1 to class_cnt                                               
     /* Set up job */                                                 
      queue "//"userid()"Z JOB (3401,S440),8048.NIIT,CLASS="class.c   
      queue "//DUMMY000  EXEC PGM=IEFBR14";   queue ""               
      "ALLOC F(INTRDR) RECFM(F) LRECL(80) SYSOUT(A) WRITER(INTRDR)"   
      "EXECIO * DISKW INTRDR (FINIS"                                 
      "FREE F(INTRDR)"                                               
 end                                                                 
                                                                     
 /* Lets see these jobs */                                           
 x = outtrap("line.","*")                                             
 address tso "status  TS09065Z"                                       
 x = outtrap("OFF")                                                   
 prev_jobnum = line.0 - class_cnt                                     
                                                                     
 /* Find the good class */                                           
 class = class.1                                                     
 status.1 = 'EXECUTING';  status.2 = 'ON OUTPUT QUEUE'               
 status_cnt = 2                                                       
 do s = 1 to status_cnt                                               
      do c = 1 to class_cnt                                           
           l = c + prev_jobnum                                       
           if (word(line.l,4) = word(status.s,1)) then class = class.c
      end                                                             
 end                                                                 
 return class                                                         
 exit 0                                                               
Back to top
View user's profile Send private message Send e-mail
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Wed Feb 25, 2004 8:54 pm    Post subject: Reply with quote

Quote: -
"Mike, I will quite try and do what you have mentioned...Learn REXX myself with inputs from you guys here at the forum..
Also as Diba pointed out, REXX is not part of my job & hence can't find I will have to learn in free time too.. "

I don't know anyone who could claim that learning rexx is part of their job - it is a utility language - you learn it because it is useful not because it is necessary. It is not our job to write code for you either. ISPF isn't 'part of your job' either but I bet you use it quite happily albeit not necessarily efficiently.

Why are you using Rexx at all if you don't want to bother learning it yourself?

Asking for code is lazy and will not help you in the long run.

The problem you are seeking to overcome could be written in any of the major programming languages supported on the mainframe so why pick a language you don't know? You could even write it in COBOL (God forbid).
_________________
My opinions are exactly that.
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 -> TSO and ISPF All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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