Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Syncsort Dupkeys

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
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    Post subject: Syncsort Dupkeys
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

Moderator


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

PostPosted: Thu Aug 22, 2013 7:38 pm    Post subject:
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    Post subject: Reply to: Syncsort Dupkeys
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us