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
 
Splitting a file equally into 7 different files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
prabhu118
Currently Banned

New User


Joined: 11 Feb 2008
Posts: 14
Location: Chennai

PostPosted: Tue Feb 12, 2008 9:24 am    Post subject: Splitting a file equally into 7 different files
Reply with quote

Hi...

Please find the requirement below:

Split a input file (record count in unknown) into say 7 output files in such a way that each of the output files contain same number of records.

for eample:
if rec count in input= 734
for splitting -> 734/7=101 27

as per the req: each out put file must contain: 101 records.
The records which is left out must be ignored.

Thanks
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Feb 12, 2008 8:38 pm    Post subject:
Reply with quote

Have you tried to alter the similar solution provided in the post titled Split a file in 5 files containing equal number of records?
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: Tue Feb 12, 2008 10:58 pm    Post subject:
Reply with quote

prabhu,

You can use the technique shown in the "Split a file to n output files dynamically" Smart DFSORT Trick at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
Back to top
View user's profile Send private message
prabhu118
Currently Banned

New User


Joined: 11 Feb 2008
Posts: 14
Location: Chennai

PostPosted: Wed Feb 13, 2008 12:52 pm    Post subject: Reply to: Splitting a file equally into 7 different files
Reply with quote

Hey thanks for all ur reponses..

i got it myself....

See the example below...

Total records in input file...= 708
if we split this by seven= each of the output file will have 101 records except the 7th which will have 102.

Now let me tell you all very clearly the exact req:
req is (from above example) to get every 101th record. Kind of sampling...

I used the sample and STARTREC option available with ICETOOL.

Please see the logic followed:
1. getting total count of rec in input file using COUNT option and writing it to say a temporary file '&&T1'
2. Dividing the count obtained in &&T1 by 7 and populating the result in other temporary file &&L1.
3. Creating a card where will get the below mentioned:
STARTREC=(VALUE IN &&L1 +1),SAMPLE=(Value in &&l1).

I know its too confusing ...
try this u will get it....

bye
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 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
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

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