Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Dynamic JCL execution

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
bobbynov201

New User


Joined: 06 Aug 2007
Posts: 12
Location: bangalore

PostPosted: Wed Apr 13, 2011 4:47 pm    Post subject: Dynamic JCL execution
Reply with quote

Hi,

Is there anyway that we can run a JCL for "n" number of times.

Say, suppose I have a file in which I have data as "10". Passing this file as i/p to the JCL, can we run the same JCL for 10 times?

Please update me on this, if anyone worked on this.

Thanks,
Sunil.
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Apr 13, 2011 4:51 pm    Post subject:
Reply with quote

Rather what you should do is ..

run one job which reads file and does some task those many times...
Back to top
View user's profile Send private message
bobbynov201

New User


Joined: 06 Aug 2007
Posts: 12
Location: bangalore

PostPosted: Wed Apr 13, 2011 4:58 pm    Post subject:
Reply with quote

Hi,

If you dont mind, could you please explain this in little detail.

Because, my requirement is I should run the same steps again and again with submitting that JCL.

Thanks,
Sunil.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Apr 13, 2011 4:58 pm    Post subject:
Reply with quote

JCL cannot loop - you can copy your "JCL" in a PROC and execute that 10 times in your Job.
Back to top
View user's profile Send private message
bobbynov201

New User


Joined: 06 Aug 2007
Posts: 12
Location: bangalore

PostPosted: Wed Apr 13, 2011 5:03 pm    Post subject:
Reply with quote

Thanks Anuj,

I will try that option, but one last question. I am not sure of the process of executing PROCs "n" number of times. So, if you have any sample JCL step could you please give me here.

Thanks,
Sunil.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Apr 13, 2011 5:15 pm    Post subject:
Reply with quote

The number of times the proc is executed would be set at the time the jcl is submitted. You loop in programs not in JCL. I would suggest you talk with someone that knows a little about how mainframe jobs are setup and excuted before you go any farther with you misdirected project.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Wed Apr 13, 2011 5:29 pm    Post subject:
Reply with quote

Quote:
Is there anyway that we can run a JCL for "n" number of times.

Say, suppose I have a file in which I have data as "10". Passing this file as i/p to the JCL, can we run the same JCL for 10 times?
ABSOLUTELY, CATEGORICALLY THIS CANNOT BE DONE.
JCL cannot loop, period. It executes the first step, tests the condition code(if applicable) to determine whether to execute the second step, tests the condition code (if applicable) to determine whether to execute the third step, and repeat for however many steps of JCL there are.

You can either submit the job N times or you can report back to whoever gave you this ridiculous assignment and tell them it cannot be accomplished. If the JCL is in a PROCLIB, you can execute the PROC N times but again there's no looping involved -- the JCL must have N EXEC statements, one for each PROC to be executed.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Apr 13, 2011 5:43 pm    Post subject:
Reply with quote

bobbynov201 wrote:
I will try that option, but one last question. I am not sure of the process of executing PROCs "n" number of times. So, if you have any sample JCL step could you please give me here.
There is no such logic - JCL will execute from - top to down, no so called, looping is involved.

I said, write your statements in a PROC and execute the PROC 10-times and you write 10 EXECs for that, as Robert has mentioned.

And I'm not sure - why this question comes around so often, think for a second why the JCL, the batch process was evolved actually and all will be revealed.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 641
Location: Whitby, ON, Canada

PostPosted: Wed Apr 13, 2011 5:51 pm    Post subject:
Reply with quote

Theoretically you could replace the JCL with an equivalent Rexx procedure and do all the looping you want. But I don't recommend it because it would take a lot of work and would probably never be accepted by Operations for use in production.
Back to top
View user's profile Send private message
bobbynov201

New User


Joined: 06 Aug 2007
Posts: 12
Location: bangalore

PostPosted: Wed Apr 13, 2011 6:00 pm    Post subject:
Reply with quote

Thanks a lot everyone for the inputs provided.

Sunil.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Wed Apr 13, 2011 6:06 pm    Post subject:
Reply with quote

Hello,
The below JCL submits the JOB inside "WELLS.GREEN.DAY(DFSORT)" 4 times.

Code:
//COPYREXX EXEC PGM=IEBGENER                                   
//SYSPRINT DD SYSOUT=*                                         
//SYSIN    DD DUMMY                                           
//SYSUT1   DD DATA,DLM='$$'                                   
/*REXX*/                                                       
 DO I = 1 TO 4  /*NUMBER OF TIMES THE JOB NEEDS TO BE RUN */   
 ADDRESS TSO "SUBMIT  'WELLS.GREEN.DAY(DFSORT)'"             
 END                                                           
 EXIT 0                                                       
$$                                                             
//SYSUT2   DD DSN=&&TEMP(TESTIT),DISP=(NEW,PASS,DELETE),       
//          UNIT=SYSDA,SPACE=(TRK,(1,1,20),RLSE),             
//          DCB=(BLKSIZE=6160,LRECL=80,RECFM=FB,DSORG=PS)     
//*                                                           
//JOBSTEP1 EXEC PGM=IKJEFT1A,DYNAMNBR=200                     
//SYSPROC  DD DSN=&&TEMP(TESTIT),DISP=(OLD,DELETE,DELETE)     
//SYSPRINT DD SYSOUT=*                                         
//SYSTSPRT DD SYSOUT=*                                         
//SYSTSIN  DD *                                               
%TESTIT                                                       
/*         



I will leave the "reading a control file and populating the '4' value part" for you to experiment.

Hope it helps.
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Wed Apr 13, 2011 6:53 pm    Post subject: Reply to: Dynamic JCL execution
Reply with quote

Sunil, we already went over this concept in your other topic:

http://www.ibmmainframes.com/viewtopic.php?t=54018&highlight=

let's stop re-hashing the same issue and move on.
Back to top
View user's profile Send private message
bobbynov201

New User


Joined: 06 Aug 2007
Posts: 12
Location: bangalore

PostPosted: Mon Apr 18, 2011 2:35 pm    Post subject:
Reply with quote

Thanks everyone for the suggestions.

Regards,
Sunil.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Creating a dynamic sort card in JCL u... ChitraChhabra DFSORT/ICETOOL 4 Wed Aug 03, 2016 6:15 pm
This topic is locked: you cannot edit posts or make replies. JCL MULTIPLE STEP EXECUTION QUERY Susanta JCL & VSAM 18 Sat Jul 30, 2016 1:17 pm
No new posts Need help on SQL Dynamic WHERE Clause subratarec DB2 12 Sat Jul 16, 2016 3:11 pm
No new posts output DDname JESMSGLG job during exe... italo_pm TSO/ISPF 16 Tue Jun 21, 2016 11:13 am
No new posts Need to create file with Dynamic Name... kapil27 JCL & VSAM 4 Wed May 25, 2016 9:45 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us