MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sum Values In a Field based on a key

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
mikemurray
Beginner


Joined: 09 Jun 2003
Posts: 4
Topics: 2

PostPosted: Tue Jun 10, 2003 8:08 pm    Post subject: Sum Values In a Field based on a key Reply with quote

I've a file:
id-a value1
id-a value2
id-b value3

I want to convert first two records into 1 record (id-a) and change the value field to value1+value2.Please post a solution in syncsort.I want to move the non-duplicate record as it is.

Thanks,
Mike
Back to top
View user's profile Send private message
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Wed Jun 11, 2003 3:05 am    Post subject: Reply with quote

Mike,

The following job should give you the results.

Code:

//STEP1    EXEC PGM=SORT 
//SORTIN   DD *           
ID-A 10                   
ID-A 10                   
ID-B 50                   
/*                       
//SORTOUT   DD SYSOUT=*   
//SYSOUT    DD SYSOUT=*   
//SYSIN    DD *           
 SORT FIELDS=(1,4,CH,A)   
 SUM FIELDS=(6,2,ZD)     
/*                       
//                       



Hope this helps...

Cheers,
Coolman
________
Honda Today
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group