AJAYREDDY
New User
Joined: 17 Feb 2007 Posts: 52 Location: USA
|
|
|
|
I have a requirement to SPLIT the file into Multiple output files in a certain count.
For example if the Input has 7000 records, I need these to SPLIT into 3 files. First file 2000 records, second file 2000 records and third file 3000 records.
If the Input has 5000 records, First file 2000 records, second file 2000 records and third file 1000 records.
The concept is, First 2 output files should have 2000 records each and the rest should go into 3rd output File.
On the other hand, if the Input file has maximum of ONLY 1500 records, these all should come inside first file and the rest 2 output files should be empty.
Right now I am assuming Input file will contain maximum of 7000 records.
Please let me know if this can be done by DFSORT or any other utility. |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//OUT1 DD DSN=... output file1
//OUT2 DD DSN=... output file2
//OUT3 DD DSN=... output file3
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=(OUT1,OUT2,OUT3),SPLIT1R=2000
/*
|
|
|