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

Need to run 2 JOBS FOR 255 TIMES


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

New User


Joined: 17 Aug 2005
Posts: 30

PostPosted: Fri Feb 03, 2006 3:30 pm
Reply with quote

Hi All,

I want to run 2 jobs say A and B for 255 times each. And I have to Run these one after the other. How can I do this.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Feb 03, 2006 4:29 pm
Reply with quote

Run JOBA. At the end of JOBA, have it SUBMIT JOBB. At the end of JOBB, have it SUBMIT JOBA. You will, of course, have to create a counter program to track the total number of submissions, and to stop the SUBMIT process after it reaches 255.
Back to top
View user's profile Send private message
vrakeshmbt

New User


Joined: 17 Aug 2005
Posts: 30

PostPosted: Fri Feb 03, 2006 4:44 pm
Reply with quote

Superk,

Can U plz suggest how can I implement counter.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Fri Feb 03, 2006 5:47 pm
Reply with quote

Create a file or member in PDS, store the counter and the next day read it, increase it.......and so on.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Fri Feb 03, 2006 7:19 pm
Reply with quote

Here is a REXX solution:

Code:
/* REXX */

DO I = 1 TO 255
  ADDRESS TSO "SUBMIT 'my.pds(joba)'"
  ADDRESS TSO "SUBMIT 'my.pds(jobb)'"
END

EXIT


O.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Feb 03, 2006 7:26 pm
Reply with quote

I was thinking of something relatively easy, such as adding a dummy record to a control dataset for each run, then checking for the record counts of the control datasets:

JOBA:
Code:

//JOBA JOB ...
//*
//STEP0001 EXEC PGM=IEBGENER                                   
//SYSUT1   DD   *                                               
NOTHING                                                         
/*                                                             
//SYSUT2   DD   DSN=&SYSUID..LOOPCTL.A,DISP=(MOD,CATLG,CATLG), 
//         UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE)                   
//SYSPRINT DD   SYSOUT=*                                       
//SYSIN    DD   DUMMY                                           
//*                                                             
//STEP0002 EXEC PGM=IDCAMS                                     
//IN       DD   DSN=&SYSUID..LOOPCTL.A,DISP=SHR                 
//OUT      DD   DUMMY,RECFM=FB,LRECL=80                         
//SYSPRINT DD   SYSOUT=*                                       
//SYSIN    DD   *                                               
  REPRO IFILE(IN) OFILE(OUT) REUSE COUNT(255)                     
/*                                                             
//*                                                             
// IF (STEP0002.RC > 0) THEN                                   
//STEPnnnn EXEC JOB A's STUFF
// ENDIF                                                       
//*                                         
//STEP9999 EXEC PGM=IKJEFT01               
//SYSTSPRT DD   SYSOUT=*                   
//SYSTSIN  DD   *                           
SUBMIT JCL(TEST339B)                       
/*                                         
//*                                         


JOBB:
Code:

//JOBB JOB ...
//*
//STEP0001 EXEC PGM=IEBGENER                                           
//SYSUT1   DD   *                                                       
NOTHING                                                                 
/*                                                                     
//SYSUT2   DD   DSN=&SYSUID..LOOPCTL.B,DISP=(MOD,CATLG,CATLG),         
//         UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE)                           
//SYSPRINT DD   SYSOUT=*                                               
//SYSIN    DD   DUMMY                                                   
//*                                                                     
//STEP0002 EXEC PGM=IDCAMS                                             
//IN       DD   DSN=&SYSUID..LOOPCTL.A,DISP=SHR                         
//OUT      DD   DUMMY,RECFM=FB,LRECL=80                                 
//SYSPRINT DD   SYSOUT=*                                               
//SYSIN    DD   *                                                       
  REPRO IFILE(IN) OFILE(OUT) REUSE COUNT(255)                             
/*                                                                     
//*                                                         
//STEP0003 EXEC PGM=IDCAMS                                 
//IN       DD   DSN=&SYSUID..LOOPCTL.B,DISP=SHR             
//OUT      DD   DUMMY,RECFM=FB,LRECL=80                     
//SYSPRINT DD   SYSOUT=*                                   
//SYSIN    DD   *                                           
  REPRO IFILE(IN) OFILE(OUT) REUSE COUNT(255)                 
/*                                                         
//*                                                         
// IF (STEP0003.RC > 0) THEN                               
//STEPnnnn EXEC JOB B's STUFF                             
// ENDIF                                                   
//*                                                         
// IF (STEP0002.RC > 0) THEN                               
//STEP9999 EXEC PGM=IKJEFT01                               
//SYSTSPRT DD   SYSOUT=*                                   
//SYSTSIN  DD   *                                           
SUBMIT JCL(TEST339A)                                       
/*                                                         
// ENDIF                                                   
//*
Back to top
View user's profile Send private message
rajesh_1183

Active User


Joined: 24 Nov 2005
Posts: 121
Location: Tadepalligudem

PostPosted: Tue Feb 07, 2006 10:20 am
Reply with quote

Hi,

Try this.......

Code:

JCL TO BE SUBMITTED.....
//STEP1 EXEC PGM=CBLPGM
//DD1    DD    DSN=TEST.PDS,DISP=SHR
//JCLDD DD    SYSOUT=(*,INTRDR)

CBLPGM:-
IN ENVIRONMENT DIVISION....
SELECT  JCLFILE ASSIGN TO JCLDD
FILE SECTION.
FD JCLFILE.
01 JCL-REC PIC X(80).
.
.
PROCEDURE DIVISION.

  PERFORM 255 TIMES
     OPEN OUTPUT JCLFILE
     MOVE '//STEP2 EXEC PGM=IKJEFT01,PARM=' '' TO JCL-REC
     WRITE JCL-REC
     MOVE '//SYSPRINT DD SYSOUT=*' TO JCL-REC
     WRITE JCL-REC
     MOVE '//SYSTSIN DD *' TO JCL-REC
     WRITE JCL-REC
     MOVE 'PROF PREFIX(USERID)' TO JCL-REC
     WRITE JCL-REC
     MOVE 'SUBMIT 'JCL1'' TO JCL-REC
     WRITE JCL-REC
     MOVE 'SUBMIT 'JCL2'' TO JCL-REC
     WRITE JCL-REC
     MOVE '/*' TO JCL-REC
     WRITE JCL-REC
     CLOSE JCLFILE
  END-PERFORM.


this might work.....

corrections welcomed...

Thanks,
Rajesh
Back to top
View user's profile Send private message
rajesh_1183

Active User


Joined: 24 Nov 2005
Posts: 121
Location: Tadepalligudem

PostPosted: Tue Feb 07, 2006 10:42 am
Reply with quote

hi superk,

tell me whether the above one is correct or not......

Thanks,
Rajesh
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 Build a record in output file and rep... DFSORT/ICETOOL 11
No new posts Submit multiple jobs from a library t... JCL & VSAM 14
Search our Forums:

Back to Top