Hi ,
I have read "Split a file to n output files dynamically" from "Smart DFSORT Tricks" but i couldnt fit my below logic there, please find my below requirements :
1) If a file contains more than 2 Million records, then additonal records should get into the next file dynamically.
2) For eg) If a file conatins 7.5 Million records , File 1 should contain 2 Million, File 2 Should contain 2 Million , File 3 should conatin 2 Million and File 4 should conatin 0.5 Million records.
3) Input record counts will vary, it may even go to an extent of 21 Million records. (In this case there would be 11 output files)
4) A member present in a file can have many record types, for eg) A,B,C ..etc but record type A is compulsory for all members and it will be the first record type to occur for for all members. So in case of split, a member should not be present in two different files. For eg) While splitting the file for a member, all record types should be present in a single file.
Example of file lay out :
Rec01 Member01 A School information
Rec02 Member01 B College information
Rec03 Member01 C Job information
Rec04 Member02 A School information
Rec05 Member02 B College information
Rec06 Member03 A School information
Rec07 Member03 C Job information
Queries :
1) Based on record count is it possible to dynamically create any number of output files ? If we declare 12 output files (max) and if the record count is low, how to handle unused output files ?
2) How to handle the record types logic for the members while splittin the file ?
Is it possible to handle this requirement in JCL or should i go for a COBOL program ?
Your help is highly appreciated !!