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

Split large FB file based on Key count into small file


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

New User


Joined: 16 Jun 2005
Posts: 2
Location: Bangalore

PostPosted: Tue Nov 01, 2022 7:43 am
Reply with quote

I want to split a large file based on Key into small file.

My Input file is where key position is 1-4 and each key can present (1-Many records)

----+----+----+----+--------+
0001 - { other data records }
0001 - { other data records }
0002 - { other data records }
0002 - { other data records }
0002 - { other data records }
0003 - { other data records }
0003 - { other data records }
0004 - { other data records }
0005 - { other data records }
0005 - { other data records }
0006 - { other data records }
....
9999 - { other data records }

I want the master input file to split into small output files based on key.
Example from Key "0001"' upto Key '"1000"' into FILE1 ;
0001 - { other data records }
....
1000 - { other data records }
then key "1001"to "2000" into FILE2
1001 - { other data records }
....
2000 - { other data records }

then key "2001"to "3000" into FILE3
2001 - { other data records }
....
3000 - { other data records }

so on so forth till FILE9
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Tue Nov 01, 2022 8:03 am
Reply with quote

You have been here for too long to use code tags . Please use them next time when you post code or results .

Try this
ibmmainframes.com/viewtopic.php?t=26644&highlight=dynamic+output+record+count
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1255
Location: Bamberg, Germany

PostPosted: Tue Nov 01, 2022 12:40 pm
Reply with quote

SPLITBY* might not match the requirement when you have duplicate keys within a range. OUTFIL with INCLUDE from and to range is more apropriate for this task.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Wed Nov 02, 2022 1:30 am
Reply with quote

I agree . Thanks
Code:
OPTION COPY
OUTFIL FNAMES=F1000,
INCLUDE=(1,4,ZD,GE,0001,AND,1,4,ZD,LE,1000)
OUTFIL FNAMES=F2000,
INCLUDE=(1,4,ZD,GE,1001,AND,1,4,ZD,LE,2000)
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Wed Nov 02, 2022 8:16 pm
Reply with quote

Ashraya HG wrote:
I want to split a large file based on Key into small file.

My Input file is where key position is 1-4 and each key can present (1-Many records)

Code:
 ----+----+----+----+--------+
0001 - { other data records  }
0001 - { other data records  }
0002 - { other data records  }
0002 - { other data records  }
0002 - { other data records  }
0003 - { other data records  }
0003 - { other data records  }
0004 - { other data records  }
0005 - { other data records  }
0005 - { other data records  }
0006 - { other data records  }
....
9999 - { other data records  }


I want the master input file to split into small output files based on key.
Example from Key "0001"' upto Key '"1000"' into FILE1 ;
Code:
0001 - { other data records  }
....
1000 - { other data records  }
then  key "1001"to "2000" into FILE2
1001 - { other data records  }
....
2000 - { other data records  }


then key "2001"to "3000" into FILE3
Code:
2001 - { other data records  }
....
3000 - { other data records  }

so on so forth till FILE9


Please find all required answers here
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 and retrive records f... DFSORT/ICETOOL 3
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
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top