Joined: 27 Aug 2007 Posts: 102 Topics: 42 Location: Chennai
Posted: Wed Mar 12, 2008 9:25 am Post subject: Sum overflow Error capture
I'm having a SUM FIELDS on a particular field in the input file and I get a SUM FIELDS OVERFLOW error. Is it possible to find for which record had the overflow occured?
for eg;
Consider this as my input
Code:
A60XXXX
B10XXXX
C70XXXX
A60XXXX
A10XXXX
and this is my sort card
Code:
SORT FIELDS=(1,1,CH,A)
SUM FIELDS=(2,2,ZD)
Now the result would be an abend "SUM FIELDS OVERFLOW"
Now is it possible to find out that the overflow has occured for the record 'A'?
I did a (,catlg,catlg) on the output dataset and found where the abend has exactly happened and I was able to trace. But is there anyother way?
Joined: 27 Aug 2007 Posts: 102 Topics: 42 Location: Chennai
Posted: Thu Mar 13, 2008 4:53 am Post subject: Re:SORT problem
Hi Kolusu,
Thanks for the reply. The 1st code you gave is working fine with the sample input I gave. But am having a problem with my actual input file.
This is the SORT card which I had modified as per your advise.
Code:
OMIT COND=(87,2,CH,EQ,C' ') <- [This is a Condition which I need to Omit]
SORT FIELDS=(5,9,CH,A,87,9,CH,A) < - [Fields 5,9 is Acct number and fields 87,9 is Cusip and I need to Sort it first by acct number and then by cusip
SUM FIELDS=(97,8,124,8,142,4,146,4),FORMAT=PD <- [ Field 146,4 is defined as PD and it is where the overflow actually occurs
OUTREC OVERLAY=(156:SEQNUM,8,ZD,RESTART=(1,1))
OUTFIL INCLUDE=(156,8,ZD,EQ,2),
BUILD=(01,155)
There were 1935368 records in the input and the output file had 1196 records. I took a record from this 1196, gave the Accout number and Cusip in the input records (i.e) is positions 5,9 and 87,9 in the input file, but found that there was a single record and the value in 146,4 was clearly not a Overflow.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Mar 13, 2008 10:50 am Post subject:
edkir98 wrote:
Thanks for the reply. The 1st code you gave is working fine with the sample input I gave. But am having a problem with my actual input file.
edkir98,
That is because you have NOT changed the code properly to meet your input. See when sort encounters an overflow while summing , it writes out multiple records for the same key as the sum overflowed
for example in your first post sample data, the output would be
Code:
A60XXXX
A70XXXX <<< over flow record
B10XXXX
C70XXXX
The key A has 3 records.
Code:
A60XXXX
A60XXXX
A10XXXX
so it summed up the last 2 and when it tried to sum up with the first record there is an overflow and sort just writes out 2 records
Code:
A60XXXX
A70XXXX
Now we trying to pick all records which are duplicates , that is where the restart parm comes into picture. The restart parm puts a seqnum at the end for the same key in ascending order and when there is a key change it starts over once again.
Joined: 27 Aug 2007 Posts: 102 Topics: 42 Location: Chennai
Posted: Fri Mar 14, 2008 3:59 am Post subject:
Hi Kolusu.. Thanks for the help. I understood the control card pretty well now. your logic was good. I dint know abt the Restart keyword and thats why was confused.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum