View previous topic :: View next topic
|
Author |
Message |
coolkarni1
New User
Joined: 10 Apr 2006 Posts: 1
|
|
|
|
I have one input file of length 80 (fixed Length).
Now I want split all the records in input file into 4 output file(FB, lenghth=80). But condition for splitting records is:
1st four records should go to 1st o/p file then 5-8 records should goto 2nd o/p file, 9-12 records should go to 3rd o/p file, 13-16 records should goto 4th o/p file and so on till i/p file EOF.
For e.g
I/p file have following records:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Now O/p file 1 should contain:
1
2
3
4
17
18
19
O/p file 2 should contain:
5
6
7
8
O/p file 3 should contain:
9
10
11
12
O/p file 4 should contain:
13
14
15
16
Can it be done using simple SORT or ICETOOL.
Thanks,
Sameer |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Sameer,
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=... outpuf file1
//OUT2 DD DSN=... outpuf file2
//OUT3 DD DSN=... outpuf file3
//OUT4 DD DSN=... outpuf file4
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=(OUT1,OUT2,OUT3,OUT4),SPLITBY=4
/*
|
|
|
Back to top |
|
|
|