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
 

 

Executing a Job Step/ Job multiple times for different Param

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

New User


Joined: 19 Apr 2005
Posts: 2

PostPosted: Fri Dec 12, 2014 7:28 am    Post subject: Executing a Job Step/ Job multiple times for different Param
Reply with quote

All,

My query as follows:
I need to process a transformation logic on a File and create Output file.
I need to perform the above same logic for around 1000 files.
Each time Input File name varies and logic will be same and Output file will get created.

Can any one assist, How can I do the above ?

One way I thought like, write the Transformation Logic in a Proc and call the Proc from Job for Number of files times.
But this involves lot of repetitive coding.

Is there any way we can do with the Looping i.e. each time the same Proc should be called but File name should be varied. Thank you.
Back to top
View user's profile Send private message

steve-myers

Active User


Joined: 30 Nov 2013
Posts: 462
Location: The Universe

PostPosted: Fri Dec 12, 2014 8:03 am    Post subject:
Reply with quote

I don't think JCL could be tricked to do something like this. One problem is there is a limit of 255 job steps in a job.

What is the source for the data set names for the input and output data sets? One mechanism would be to prepare JCL and submit a single job for each data set pair. Another mechanism would be to use dynamic allocation to allocate the data sets, then run the program as a subroutine of the controller. When the program completes use dynamic allocation again to release the data sets. One problem with this approach is the program is run serially, where with the first approach the jobs could potentially be run in parallel.
Back to top
View user's profile Send private message
beeram527

New User


Joined: 19 Apr 2005
Posts: 2

PostPosted: Fri Dec 12, 2014 8:21 am    Post subject:
Reply with quote

Thanks Steve.
With the Proc approach I might need to write 10 or more JCLs accordingly with each of 100 steps, due to limit of 255.

Dataset names could be as follows:
Input Dataset will be : Qual1.Qual2.Qual3.IFil1
Qual1.Qual2.Qual3.IFil2
...

Output Files will be : Qual1.Qual2.Qual3.OFil1
Qual1.Qual2.Qual3.OFil2
....

We know the Dataset names well in advance so can write some where or can Pass accordingly.

I have doubt on this:
Another mechanism would be to use dynamic allocation to allocate the data sets, then run the program as a subroutine of the controller. When the program completes use dynamic allocation again to release the data sets.

Would this be done through Cobol program ??
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 462
Location: The Universe

PostPosted: Fri Dec 12, 2014 9:29 am    Post subject:
Reply with quote

beeram527 wrote:
... I have doubt on this:
Another mechanism would be to use dynamic allocation to allocate the data sets, then run the program as a subroutine of the controller. When the program completes use dynamic allocation again to release the data sets.

Would this be done through Cobol program ??
Yes, it can be done through Cobol. You can use the BPXWDYN external function to do the dynamic allocations.

I'm not really an expert on BPXWDYN. The basic idea is you send it a character string that resembles the TSO ALLOCATE or FREE commands. For better or worse, its documentation is difficult to find.
Back to top
View user's profile Send private message
prino

Active Member


Joined: 07 Feb 2009
Posts: 984
Location: Oostende, Belgium

PostPosted: Fri Dec 12, 2014 3:22 pm    Post subject: Reply to: Executing a Job Step/ Job multiple times for diffe
Reply with quote

BPXWDYN: Text Interface to Dynamic Allocation and Dynamic Output

FWIW, I think Enterprise PL/I can do dynamic allocations all by itself nowadays, may be so can Enterprise COBOL...
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 462
Location: The Universe

PostPosted: Sat Dec 13, 2014 9:02 am    Post subject:
Reply with quote

Why program anything? This task can be done very easily in TSO in batch.
Code:
//A       EXEC PGM=IKJEFT01
//SYSTSPRT DD  SYSOUT=*
//SYSTSIN  DD  *
ALLOC FILE(INPUT) SHR DSN('input data set')
ALLOC FILE(OUTPUT) OLD DSN('output data set')
CALL 'program-lib(program)'
ALLOC FILE(INPUT) REUS DA('input data set')
ALLOC FILE(OUTPUT) REUS DA('output data set')
CALL 'program-lib(program)'
...

Obviously some of the statements need work, especially the ALLOC FILE(OUTPUT) statements, but this has to be easier than writing Cobol programs.
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 Easytrieve - Report writing - Only 1 ... Abhi Nature CA Products 2 Wed Sep 14, 2016 11:40 am
No new posts How to calculate an specific transact... lind sh CICS 2 Tue Sep 13, 2016 9:20 pm
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 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


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