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: 2963
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

Active Member


Joined: 15 Aug 2015
Posts: 940
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: 2963
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: 1650

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 File Aid Batch IBM Tools 7
No new posts To replace jobname in a file with ano... SYNCSORT 12
No new posts Converting fixed length file to excel... IBM Tools 7
No new posts Extract record using 2 input file int... JCL & VSAM 2
No new posts I want to append a record in an exist... CLIST & REXX 17
Search our Forums:

Back to Top