MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sum overflow Error capture

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
edkir98
Beginner


Joined: 27 Aug 2007
Posts: 102
Topics: 42
Location: Chennai

PostPosted: Wed Mar 12, 2008 9:25 am    Post subject: Sum overflow Error capture Reply with quote

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?

I hope I am clear

Thanks
Ed
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Mar 12, 2008 10:12 am    Post subject: Reply with quote

edkir98,

Try these control cards.

Code:

//SYSIN    DD *                                   
  OPTION OVFLO=RC4                                 
  SORT FIELDS=(1,1,CH,A)                           
  SUM FIELDS=(2,2,ZD)                             
  OUTREC OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,1))   
  OUTFIL INCLUDE=(81,8,ZD,EQ,2),                   
  BUILD=(01,10)                                   
/*


The best way to avoid overflow errors is to use the Reporting features of DFSORT.

Code:

//SYSIN    DD *               
  OPTION EQUALS               
  SORT FIELDS=(1,1,CH,A)       
  OUTFIL REMOVECC,NODETAIL,   
  SECTIONS=(1,1,               
  TRAILER3=(1,1,TOT=(2,2,ZD)))
/*                           


Hope this helps...
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
edkir98
Beginner


Joined: 27 Aug 2007
Posts: 102
Topics: 42
Location: Chennai

PostPosted: Thu Mar 13, 2008 4:53 am    Post subject: Re:SORT problem Reply with quote

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.

Can you please help? I hope I made it clear
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Mar 13, 2008 10:50 am    Post subject: Reply with quote

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.

So try these control cards which suit your input.

Code:


//SYSIN   DD *
  OPTION OVFLO=RC4,EQUALS 
  OMIT COND=(87,2,CH,EQ,C' ')
  SORT FIELDS=(05,09,CH,A,87,09,CH,A)
  SUM FIELDS=(97,8,124,8,142,4,146,4),FORMAT=PD
  OUTREC IFTHEN=(WHEN=INIT,
        OVERLAY=(156:05,09,87,09,SEQNUM,8,ZD,RESTART=(156,18)))
  OUTFIL INCLUDE=(174,8,ZD,GE,2),
  BUILD=(01,155)                 
/*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
edkir98
Beginner


Joined: 27 Aug 2007
Posts: 102
Topics: 42
Location: Chennai

PostPosted: Fri Mar 14, 2008 3:59 am    Post subject: Reply with quote

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.

Thanks
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group