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 Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm


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