Hi,
I have an input file (lrecl=168, fb) like below with a header with 90,trailer with 91 and 92:-
9047512911125
15004751160053568221000Z N7492900110000017635526106224299040800000000000
1501 0334211FRAUD TRANS C/H DOC ATT
1505000000000000000000000000000 0000 000000000000
15004751180006653086000Z N7467858111804013384496911125253042700000000000
1501 0334291FRAUD TRANS CH DOC ATT
1505000000000000000000000000000 00 0000 000000000000N
15004751180006653086000Z N7405657111808000010436310020895042700000000000
1501 0334301FRAUD TRANS CH DOC ATT
1505000000000000000000000000000 0000 000000000000
910000000000000000000000000000000000000144000001000000002408
920047512911125000000000000000000000000144000001000000003410000000
This file has records in groups defined as per the 4th character of the file (from 0 to 9)
That means maximum it can have 10 rows for each group minimum can be 1 row starting 0.
hence record starting 1500,1501 and 1505 is one group(1st,2nd and 3rd record after the header) and so on.
My trailer starting 91 is defined as:-
* Definition for TC91 Trailers for adding up
AA,1,2,UFF
BB,16,15,ZD
CC,31,12,ZD
DD,43,6,ZD
EE,49,12,ZD
FF,75,9,ZD
GG,102,15,ZD
toolin is:-
SORT FROM(INFILE) TO(OUTFILE,TEMPFILE) USING(TC91)
TC91 is :-
INCLUDE COND=(AA,EQ,91)
SORT FIELDS=(AA,A)
SUM FIELDS=(BB,
CC,
DD,
EE,
FF,
GG)
This is existing logic.
This file goes to another system which does not except a file with more than 3300 records.
Hence need to put this tC91 batch trailer before every 3300th logical record.
That means may put a trailer tc91 any where between 3250 to 3300 logical record.
By logical means it should be in between two groups like if below are two groups :-
15004751180006653086000Z N7467858111804013384496911125253042700000000000
1501 0334291FRAUD TRANS CH DOC ATT
1505000000000000000000000000000 00 0000 000000000000N
15004751180006653086000Z N7405657111808000010436310020895042700000000000
1501 0334301FRAUD TRANS CH DOC ATT
1505000000000000000000000000000 0000 000000000000
Then trailer should be placed in:-
15004751180006653086000Z N7467858111804013384496911125253042700000000000
1501 0334291FRAUD TRANS CH DOC ATT
1505000000000000000000000000000 00 0000 000000000000N
910000000000000000000000000000000000000144000001000000002408 <Trailer>
15004751180006653086000Z N7405657111808000010436310020895042700000000000
1501 0334301FRAUD TRANS CH DOC ATT
1505000000000000000000000000000 0000 000000000000
Also don't know how big can be the file so it should be itterative
like a trailer should be between 3250-3300, 6550-6600 and so on.......
Is it possible through icetool?
If yes then please let me know how.
I tried to give an example in my last post but seems was not able to explain it well.
I hope this time its detailed.
Thanks,