View previous topic :: View next topic
|
Author |
Message |
prabhu118 Currently Banned New User
Joined: 11 Feb 2008 Posts: 14 Location: Chennai
|
|
|
|
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 |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
prabhu118 Currently Banned New User
Joined: 11 Feb 2008 Posts: 14 Location: Chennai
|
|
|
|
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 |
|
|
|