Page 1 of 2

JCL- dynamic unloads

PostPosted: Tue Jun 29, 2010 11:28 am
by dingdong
Hi All ,

Can you please help me design a loagic using COBOL and JCL where I can make dynamic unload JCLs .So that I can read a dataset having list of many db2 tables and then extract the unload of each of those tables in separate data sets.
An internal reader needs to be used . The correson ding table spaces can be extracted from sys ibm tables but how do I pass it dynamically t the jcl each time ?

Re: JCL- dynamic unloads

PostPosted: Tue Jun 29, 2010 11:58 am
by expat
I would consider using ISPF file tailoring services. It builds JCL very effectively.

Re: JCL- dynamic unloads

PostPosted: Tue Jun 29, 2010 1:53 pm
by dingdong
Yes by ISPF tailoring services ... but the point that has to be considered is that the input file may contain any number of table names in the input file ... For each table the unload has to be generated .The table space will have to be determined for each table and then the unload has to be taken .. but can anyone suggest the best way to keep unloads of tables as the input list could be dynamic

Re: JCL- dynamic unloads

PostPosted: Tue Jun 29, 2010 2:19 pm
by enrico-sorichetti
looks like You want to do something You have not the slightest understanding about,
and ask us to so the work for You

Re: JCL- dynamic unloads

PostPosted: Tue Jun 29, 2010 2:29 pm
by dingdong
I disagree.

The situation is like this ...
I will have a input file having list of table names at the end of every day .The number of table names can change everyday .
The requirement is that the unload of each of these tables have to be taken .
hence a cobol program (CBL1) has to be written where each table name is read ,then the details of the same have to be used for constructing a JCL to take unload of each table .So the output of CBL1 should be the JCL for taking unload

Now a new JCL has to be trigerred so that this output of CB1 can be used as a input and the output result of unloading can be captured .
Hope it is clear now

Re: JCL- dynamic unloads

PostPosted: Tue Jun 29, 2010 2:58 pm
by enrico-sorichetti
You might disagree...
but this is a help forum, not a do it for me one...

show what You have done and where You are facing issues
and somebody will be glad to help You

it would be more productive to do it using REXX

Re: JCL- dynamic unloads

PostPosted: Tue Jun 29, 2010 3:12 pm
by enrico-sorichetti
but the point that has to be considered is that the input file may contain any number of table names in the input file

if You had some ISPF knowledge You would know that is not an issue

/pseudocode on
... some initiation housekeeping
FTOPEN
FTINCLUDE JOBSTART skel
do forever
    read the input table name
    if end of file then leave the loop
    retrieve the info on the table name and build the proper tokens
    FTINCLUDE STEP skel
    set a flag to indicate that at least one step was built
end
FTINCLUDE JOBEND skel
FTCLOSE
if at least one step was built then  submit the jcl You have just built
... some termination housekeeping


the longest time would be to determine and build the proper skel layout

Re: JCL- dynamic unloads

PostPosted: Tue Jun 29, 2010 3:15 pm
by enrico-sorichetti

Re: JCL- dynamic unloads

PostPosted: Tue Jun 29, 2010 4:02 pm
by dingdong
Well ...some more points I want to put . I dont want to process it 1 table at a time ... I want to build(from a COBOL program run by JCL1) a unload JCL(JCL2) having as many steps as the number of tables (for each table name ) .So each step must have the table name read from the file for taking unload which must be passed from the cobol program to the JCL2 being built .therefore a 25 step JCL must be built if 25 names are there in the table .

The things that need to be parameterised are the table names and also the names of the output files . Also a new step needs to be introduced in the JCL 1 to run the JCL2 in output file of step 1.

Re: JCL- dynamic unloads

PostPosted: Tue Jun 29, 2010 4:26 pm
by enrico-sorichetti
I am just wasting time trying to give good advice to somebody who cannot even read and understand the suggestions given.

my pseudo logic does just that... build ONE job with as many steps as the tables to be unloaded