IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Split all the records in input file into 4 output file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
coolkarni1

New User


Joined: 10 Apr 2006
Posts: 1

PostPosted: Wed Feb 14, 2007 7:24 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Feb 14, 2007 9:55 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top