IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

overflow sum fields


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bsaxton

New User


Joined: 11 Sep 2008
Posts: 4
Location: mississippi

PostPosted: Thu Mar 29, 2012 9:29 pm
Reply with quote

how to increase these sum fields to prevent overflow(duplicate) records?
SUM FIELDS=(41,5,PD,46,3,PD,49,5,PD,54,4,PD,60,5,PD)
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Mar 29, 2012 9:33 pm
Reply with quote

It is traditional to start a new topic for a new question. Although this might be the "shortest" tailgater in history...

One of us ought to be embarrassed, at least, but I haven't the remotest idea of what you are actually asking :-)

Can you re-state the problem, with example input and expected output. Recfm/lrecl of files involved. Information about how to get Saints tickets, etc, please?
Back to top
View user's profile Send private message
bsaxton

New User


Joined: 11 Sep 2008
Posts: 4
Location: mississippi

PostPosted: Thu Mar 29, 2012 9:39 pm
Reply with quote

thanks..
problem i'm having with sorting a file and encountering duplicate records where too much money is present in the fields i am summing.
Organization . . . : PS
Record format . . . : FB
Record length . . . : 70
Block size . . . . : 6230

example of data
TB-GROSS-TAX
5/PS
(41-45)
9-----------
TOP OF DATA
18737.85
21414.61
64725.15
53728.34

waiting on Bill Parcells commitment before ticket purchase!
thanks
billy
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Thu Mar 29, 2012 9:48 pm
Reply with quote

bsaxton,

If SUM FIELDS is all you are doing, you can use SECTIONS/TRAILER3 function with TOT to expand field size while summing. Alternatively, you can expand the field size in advance and then do summing as well.

You would have received ICE152I message. Read explanation for that under Programmer Response:
If appropriate, redesign the records so that summary fields do not overflow, or, if possible, use INREC to increase the size of the summary fields (see z/OS DFSORT Application Programming Guide ), or specify the OVFLO=RC0, OVFLO=RC4, or OVFLO=RC16 run-time option to provide
a different return code for this situation.

Bill,
OP is referring to the situation where DFSort, upon overflow condition, sets RC4 (if OVFLO=RC4 installation is set) and creates/splits record in to multiples.

For better answer, please provide complete sort card.

Thanks,
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Mar 29, 2012 9:50 pm
Reply with quote

See to be far too many Bills to keep track of on this one...

Anyway, if there is ever too much money anywhere, feel free to contact me and I'll be happy to relieve you of the excess...

You are summing and the fields being summed-into are too small? I don't get the "duplicate" problem. Can you show all your SORT cards and the messages showing the failure?
Back to top
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Thu Mar 29, 2012 10:19 pm
Reply with quote

You can use the trailer option.

Code:
//STEP010 EXEC PGM=SORT                                   
//SYSPRINT  DD SYSOUT=*                                   
//SYSOUT    DD SYSOUT=*                                   
//SORTIN    DD *                                         
ArqËÌ*                                                   
ArqËÌ*                                                   
ArqËÌ*                                                   
ArqËÌ*                                                   
ArqËÌ*                                                   
BrqËÌ*                                                   
BrqËÌ*                                                   
BrqËÌ*                                                   
BrqËÌ*                                                   
BrqËÌ*                                                   
//SORTOUT   DD SYSOUT=*                                   
//SYSIN  DD  *                                           
 SORT FIELDS=(1,1,CH,A)                                   
 OUTFIL FNAMES=SORTOUT,REMOVECC,NODETAIL,                 
 SECTIONS=(1,1,                                           
 TRAILER3=(1:1,1,2:TOT=(2,5,PD,M10)))                     
/*                                               


Input Value in Zoned Decimal Format

Code:
A9998737.85
A9998737.85
A9998737.85
A9998737.85
A9998737.85
B9998737.85
B9998737.85
B9998737.85
B9998737.85
B9998737.85


Output:

Code:
A     4999368925
B     4999368925
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Mar 29, 2012 11:58 pm
Reply with quote

bsaxton,

For an example with SUM, see:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA60/3.20.2.5?SHELF=&DT=20110608113434
Back to top
View user's profile Send private message
bsaxton

New User


Joined: 11 Sep 2008
Posts: 4
Location: mississippi

PostPosted: Thu Apr 05, 2012 9:20 pm
Reply with quote

thanks guys, did make some progress, but only on one of the fields, using this inrec
SORT FIELDS=(4,5,CH,A)
OMIT COND=(1,1,CH,NE,C'X')
INREC FIELDS=(1,40,41:X'00',42:41,6,48:46,24)
SUM FIELDS=(41,6,PD)

the field in question (tb-gross-tax) did not overflow, guess i need to use same method on the other fields!
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Apr 05, 2012 9:33 pm
Reply with quote

Yes, go for it!

Just a thought:

Code:
INREC FIELDS=(1,40,41:X'00',42:41,6,48:46,24)


You've made that more complicated than it need be by specifying columns at the same position in the INREC record as you already are at the time. You specify 41: when 41 is already the next position, same with 42: and 48:.

Code:
INREC FIELDS=(1,40,X'00',41,6,46,24)


However, if I take out the columns it becomes clear that you have built a couple of bytes twice. 41,6 and 46,24 have an overlap, bytes 46 and 47 being used twice. Did you want that?
Back to top
View user's profile Send private message
bsaxton

New User


Joined: 11 Sep 2008
Posts: 4
Location: mississippi

PostPosted: Thu Apr 05, 2012 10:32 pm
Reply with quote

thanks.. this does make it easier.. and i was over stepping myself.. i've tried to do same with 2 other fields.. but looks like i may need more than just one zero.. how to insert two? x'0000'

this is my lateste try
INREC FIELDS=(1,40,X'00',41,6,X'00',47,4,X'00',51,6,57,13)

it works but getting overflow in field 47,4
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Apr 05, 2012 10:35 pm
Reply with quote

bsaxton wrote:
thanks.. this does make it easier.. and i was over stepping myself.. i've tried to do same with 2 other fields.. but looks like i may need more than just one zero.. how to insert two? x'0000'

this is my lateste try
INREC FIELDS=(1,40,X'00',41,6,X'00',47,4,X'00',51,6,57,13)

it works but getting overflow in field 47,4


Quite Simple . You can use X'0000' or 2Z to insert 2 binary zeroes.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
No new posts Assembler: Set Program Mask for decim... PL/I & Assembler 4
No new posts Cobol COMP-2 fields getting scrambled... Java & MQSeries 6
No new posts Converting unpacked fields to pack us... SYNCSORT 4
No new posts Data for newly added fields not displ... IMS DB/DC 6
Search our Forums:

Back to Top