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
 

 

How to solve this Problem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to solve this Problem
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: 1452
Location: Chicago, IL

PostPosted: Fri Jun 24, 2005 6:04 pm    Post subject: Re: How to solve this Problem
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
No new posts DB2 Streaming Batch Processing Problem Manshadi DB2 4 Sat Sep 24, 2016 12:14 pm
No new posts Problem with GETMAIN command amitc23 CICS 6 Thu Sep 01, 2016 1:01 pm


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