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

How to solve this Problem


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sonasheetal

New User


Joined: 08 Jun 2005
Posts: 27

PostPosted: Fri Jun 24, 2005 2:40 pm
Reply with quote

I've a file which contains two fields named 'Customer Name' and 'Amount'.There are 50 records in this file. Customer Name is not unique. The requirement is like, I want to add up the amounts of Customers who are having the same name and write it into another file. The resulting file should not contain any duplicate names.

Eg: File 1 Layout:

Customer Name Amount
----------------------------------------------------------------------
A 10
B 20
C 30
A 40
C 90

Resulting file should be

Customer Name Amount
----------------------------------------------------------------------
A 50
B 20
C 120
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Fri Jun 24, 2005 6:04 pm
Reply with quote

Hi sonasheetal,

Try this Code....

Code:
//STEP1      EXEC  PGM=ICEMAN                         
//SYSOUT   DD  SYSOUT=*                           
//SORTIN DD DSN=RECORDS.INPUT,DISP=SHR   
//SORTOUT  DD DSN=RECORDS.OUTPUT,DISP=....
//SYSIN   DD    *                                 
 SORT FIELDS=(1,1,CH,A)                           
 OUTFIL REMOVECC,NODETAIL,                       
  SECTIONS=(1,1,                                 
   TRAILER3=(1,2,                                 
    3:TOT=(3,3,SFF)))                             
/*


For more information on this utility....visit this link........

[url]http://www-1.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmst02.html#t07 [/url]

Regards,

Priyesh.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts z/vm installation problem All Other Mainframe Topics 0
No new posts Job scheduling problem. JCL & VSAM 9
No new posts how to solve this power failure shutd... ABENDS & Debugging 5
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
Search our Forums:

Back to Top