Posted: Wed Jul 19, 2006 5:10 am Post subject: matching records between two files and summing a field
Members,
I have a requirement with 2 files each having Headers individually and some records in it say 10 records in File 1 and 20 records in File 2 and there is a count which is present in the headers record .I want to generate an ouput File 3 as shown below with a record matching with first 10 bytes from File 1 in File2 and in the output i want the matching records as well the header with the summation of the count of (35 + 40 = 75 ).Can anybody help me in this requirement ?
FILE 1
Code:
ABC REPORT FOR UNIVERSITY EMPLOYEES 35
RECORD1
RECORD2
....
....
FILE 2
Code:
XYZ REPORT FOR UNIVERSITY EMPLOYEES 40
RECORD1
RECORD2
....
....
OUTPUT DESIRED FILE 3
Code:
FIN REPORT FOR UNIVERSITY EMPLOYEES 75
RECORD MATCHING IN FILE 1 WITH FILE2 ONLY 10 BYTES
RECORD MATCHING IN FILE 1 WITH FILE2 ONLY 10 BYTES
....
....
Thanks for you immediate reply.A slight modification is that i need only the count of two values ( 30 + 45 = 75 ) instead of the record matching conditions that means i would need only the sum of the count and display in header so can u please tell me the modified JCL.
FILE 1
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
ABC REPORT FOR UNIVERSITY EMPLOYEES 35
RECORD1
RECORD2
....
....
FILE 2
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
XYZ REPORT FOR UNIVERSITY EMPLOYEES 40
RECORD1
RECORD2
....
....
OUTPUT DESIRED FILE 3
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
FIN REPORT FOR UNIVERSITY EMPLOYEES 75
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Jul 19, 2006 7:20 am Post subject:
Quote:
Thanks for you immediate reply.A slight modification is that i need only the count of two values ( 30 + 45 = 75 ) instead of the record matching conditions that means i would need only the sum of the count and display in header so can u please tell me the modified JCL.
Mfuser,
Why can't you put your requirements all at once? I just cannot spend time posting solutions everytime you change your requirement.
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