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

Syncsort Dupkeys


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Aug 22, 2013 7:31 pm
Reply with quote

Hi,

I am trying below SORT but don't get expected results !? I am adding up values shown at 3rd column based on key at 1st position and write the sum to output. I get right output on key C only icon_confused.gif Everything else is wrong icon_sad.gif

Code:

//DUPKEY01 EXEC PGM=SORT   
//SYSOUT   DD SYSOUT=*     
//SORTOUT  DD SYSOUT=*     
//SORTXDUP DD SYSOUT=*     
//SORTIN   DD *           
B 333333                   
B 999999                   
A 111111                   
A 999999                   
C 111111                   
C 222222                   
C 333333                   
//SYSIN DD *               
  SORT FIELDS=(1,1,CH,A)   
  DUPKEYS SUM=(3,6,ZD),XDUP
//                         


Results from above job:
Code:

A 111111
A 999999
B 333333
B 999999
C 666666


Expected Results:
Code:

A 1111110
B 1333332
C 0666666


Please help.

Thanks in advance.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Aug 22, 2013 7:38 pm
Reply with quote

Do an inrec overlay to convert the 6 digits to 7 and then do a SUM FIELDS
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Aug 22, 2013 8:06 pm
Reply with quote

Hi,

Thanks for the super idea and I've got the results..

Code:

//SYSIN DD *               
  INREC BUILD=(1,2,C'0',3,6)
  SORT FIELDS=(1,1,CH,A)   
  DUPKEYS SUM=(3,7,ZD),XDUP
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts Syncsort "Y2C" Function SYNCSORT 1
No new posts Arithmetic division using Syncsort SYNCSORT 6
Search our Forums:

Back to Top