Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
Hi,
I have file with lrecl-370 and recfm FB. Field 'first name' starts @ col 20-49 (length 30).
My requirement is to split the file dynamically on this field. i.e., if the file contains 10 names (name may repeat), I need 10 o/p files.
Example:
Code:
----+----1----+----2----+----3----+----4----+----5----+----6
***************************** Top of Data ******************
STEVE
MALCOM
MALCOM
MALCOM
MALCOM
MALCOM
ANDREW
ANDREW
STEVE
STEVE
JOHN
ANDREW
**************************** Bottom of Data ****************
I need all STEVEs in 1 file, JOHNs in another file etc... (total 4 o/p files for the above example).
Please note that the field values generally change across runs. Also rec count is unknown and expecting the (uniq) names somewhere between 70-90.
I could not find any topic suitable for this requirement in DFSORT forum.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You can use this strategy with DFSORT/ICETOOL:
Use SELECT FIRST to get one record for each name and generate an OUTFIL FNAMES=Annn,INCLUDE=(p,m,CH,EQ,C'name') statement for that name in a temporary file that you can use as the control statements in a subsequent step or operator. You'll need the appropriate //Annn DD statements (or you can generate those too).
Frank,
Probably murli is pointing into dynamically deciding and creating on the number of o/p files!
I remember you had proposed a solution in one of the previous posts where you had suggested to use INTRDR, but i was not able to get that post(probably it was in JCL forum)....