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

Problem with 'SUM FIELDS' in dfsort.


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

New User


Joined: 15 Jan 2007
Posts: 36
Location: Kerala

PostPosted: Mon Oct 12, 2009 5:05 pm
Reply with quote

I am trying to do a 'SUM FIELD' sort shown below: -

//STEP01 EXEC PGM=SORT
//STEPLIB DD DSN=SYS1.SORTLIB,DISP=SHR
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=IHC$017.CBF.EXTRACT.FIL,
// DISP=SHR
//SORTOUT DD DSN=IHC$017.CBF.EXTRACT.FIL99,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(125,(12,1),RLSE),
// DCB=(LRECL=133,DSORG=PS,RECFM=FM)
//SYSIN DD *
SORT FIELDS=(9,3,ZD,A)
SUM FIELDS=(79,10,ZD)
/*
//

However for two records which has to be summed based on this, the field values are 0000000057 and 0000000057.

However the summed value in the output file is '000000010D' instead of '0000000104'. However once i do hex on, the hex values are showing 104.

Can anyone tell what is the problem and how to eliminate this problem.
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: Mon Oct 12, 2009 8:57 pm
Reply with quote

Add the following to SYSIN:

Code:

    OPTION ZDPRINT


That will give you an F sign for the summed ZD values rather than a C sign (note that both are valid for ZD values).
Back to top
View user's profile Send private message
bijoybabu83

New User


Joined: 15 Jan 2007
Posts: 36
Location: Kerala

PostPosted: Tue Oct 13, 2009 4:25 pm
Reply with quote

Thank you so much frank...It worked now.

Can you please tell what is 'F' sign and 'C' sign in DFSORT. Kindly Bear with me for bugging you...
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: Tue Oct 13, 2009 9:20 pm
Reply with quote

A 3-byte ZD value looks like this in hex:

zdzdsd

where z is the zone (usually F), d is a digit (0-9) and s is the sign.

Normally, for ZD fields, the sign is C or F for positive and D for negative. Both C and F are valid signs for positive ZD values. If the F sign is used for positive values, then the value is "displayable" - for example, +123 would be X'F1F2F3' = '123'. If the C sign is used for positive values, then value is not displayable - for example, +123 would be X'F1F2C3' = '12C'.
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
Search our Forums:

Back to Top