Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Split all the records in input file into 4 output file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Split all the records in input file into 4 output file
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 Moderator


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

PostPosted: Wed Feb 14, 2007 9:55 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us