Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us