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
 

 

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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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