Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Sum up the fields in case of Duplicate Records.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Fri Nov 03, 2006 11:41 am    Post subject: Sum up the fields in case of Duplicate Records.
Reply with quote

HI,

Could anyone provide me a solution..for this??

I have 2 inputs.

I need to sort then base on few fields.
If Duplicates are found, i need to add the fields and remove the duplicate record.

INPUT 1:

Code:

----+----1----+----2
***************
AAABBB  100  1T
XXXYYY  150 11T
KKKVVV 1100101T
***************


Input 2:

Code:

----+----1----+----2
********************
AAABBB  100  1T
XXXYYY 1150 19T
********************


I need to sort on the fields frm 1 to 3, then 7 to 13.
The output should have like:

Code:

AAABBB  200  2T
XXXYYY 1300 30T
KKKVVV 1100101T



Thanks in advance
~Vamsi
Back to top
View user's profile Send private message

shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Fri Nov 03, 2006 2:49 pm    Post subject:
Reply with quote

hi,
I got it..
This is how it can be acheived.

Code:

//STEP01 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file1
//            DD DSN=...  input file2
//SORTOUT DD DSN=...  output file
//SYSIN  DD  *
  SORT FIELDS=(1,6,CH,A)
  OPTION ZDPRINT
  SUM FIELDS=(7,5,ZD,12,3,ZD)
/*


~Vamsi
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us