Placing a trailer near to 3300th logical record.



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Placing a trailer near to 3300th logical record.

Postby Swati Gupta » Fri May 20, 2011 11:40 am

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,
Swat P,
India
Swati Gupta
 
Posts: 10
Joined: Thu May 05, 2011 1:19 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Placing a trailer near to 3300th logical record.

Postby enrico-sorichetti » Fri May 20, 2011 12:11 pm

the clarity is the same as the one in Your previous post on the topic... almost none :D

let' s define the problem in words / metalanguage

current situation
one file composed of <groups>
where

file : obvious
<group> set of records composed of header(S) + one or more data records + trailer(S)

requested situation
one file composed of <blocks>
where

file : obvious definitions
<block> set of <groups> composed of one or more <groups> + trailer(S)
<group> set of records composed of header(S) + one or more data records + trailer(S) (SAME AS BEFORE)
with the constraint that each <block> must contain less than <N> records

in this case 3300, in the previous case 30

at first glance no utility will be able to do it
at each <group> trailer You need to forward scan the file to see how many records are in the next group
and if they fit in the current <block>
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post