Joined: 05 Jun 2005 Posts: 165 Location: Bangalore
1. OPEN INPUT FILE1, FILE2.
2. OPEN OUTPUT FILE3.
3. READ FILE2.
4. MOVE ACCOUNT-NO2 TO ACCOUNT-NO1.
5. READ FILE1 RECORD KEY IS ACCOUNT-NO1.
6. COMPUTE THE VALUE OF SALES-AMOUNT.
7. WRITE FILE-REC3.
8. CLOSE FILE1, FILE2, FILE3.
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
This will only work well if file1 is a vsam file.
If these are both qsam files, you could use a 2-file match/merge to get the result you want.
If you are not familiar with this, there is a "Sticky" near the top of the COBOL section of the forum. Download the sample code, review it, and post back here if there are any questions. The sample is bvery close to your requirement.