How to create dynamic out datasets based on i/p records?



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

How to create dynamic out datasets based on i/p records?

Postby maandi » Mon Nov 22, 2010 8:03 pm

Hi,
My task is to create output datasets for each and every unique numbers present in my input file.

I have a input file which looks like this...

xxxxx 11001 xxxxxxxxxxxxxxxx
xxxxx 11002 xxxxxxxxxxxxxxxx
xxxxx 11003 xxxxxxxxxxxxxxxxx
xxxxx 11002 xxxxxxxxxxxxxxxxx

In this i have to dynamically create corresponding datasets for the unique numbers mentioned above.

for eg:
records which is having no as 11001 should be in one output dataset
records which are having 11002(here 2 records are there) should be in another out dataset...

The same scenario should continue for N no of records.... (in my case its max of 25)
Note: every time my unique numbers might change according to the input.... so i cant cross reference this with any hard coded data also.

I have no idea how far this can be done through JCL or cobol.
Thanks,
Maandi...
maandi
 
Posts: 20
Joined: Sat Oct 30, 2010 1:37 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to create dynamic out datasets based on i/p records?

 

Re: How to create dynamic out datasets based on i/p records?

Postby NicC » Mon Nov 22, 2010 8:53 pm

You cannot do it with 'JCL' - that is not what JCL is about. Your best bet is probably to to look at the DFSORT tricks PDF and study the various ways a file may be split using DFSORT
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: How to create dynamic out datasets based on i/p records?

Postby MrSpock » Mon Nov 22, 2010 11:41 pm

Maandi, I concur with reviewing the DFSORT Smart Tricks document and reviewing the SPLIT or SPLITBY functions. However, you haven't provided a crucial detail. How do you intend to deal with the required DD statements? Are you going to code 25 unique DD statements and datasets in the JCL? Are you passing the data through the process first to determine how many DD's and datasets will be required? Will you be generating some sort of dynamic JCL to be submitted to the JES Internal Reader, or will it be written to a dataset to be used by a subsequent job?
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: How to create dynamic out datasets based on i/p records?

Postby dick scherrer » Tue Nov 23, 2010 1:12 am

Hello and welcome to the forum,

Actually splitting the file in cobol is fairly trivial. Managing the output datasets might not be. . .

How is the output to be used? Will these split files survive beyond their next use?

Why is there a need to create multiple files - why not sort the original file in the order needed for the subsequent processing?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: How to create dynamic out datasets based on i/p records?

Postby maandi » Tue Nov 23, 2010 2:42 pm

Hi All,

Thanks for the your suggestions. DFSORT tricks PDF might be useful for me..

Actually the process goes like this.... i will get the customer file individually from the front end in CSV format... Say for e.g. i get 'N' no of customer files (each customer file will have no of records)... those files will be converted and merged into single flat file and it will processed...
After processing i need to separate it and create the same 'N' no of outputs according to the customer no... say one PS file for one customer. These N no of PS files will be converted to their corresponding CSV formats and will be send back to front end.

Are you passing the data through the process first to determine how many DD's and datasets will be required?
Yes. First i need to determine the no of o/p datasets to be created based on the no of input files i get.

How is the output to be used? Will these split files survive beyond their next use?
The output will be converted to CSV formats individually and will be sent to front end server.

Thanks,
Maandi
maandi
 
Posts: 20
Joined: Sat Oct 30, 2010 1:37 am
Has thanked: 0 time
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post