Hi
I want to concatenate 2 files
1) Header records in both the files are same, So I want only one header in output file
2) Should get all detail records from both the files
3) Trailer records in both the files are same except record count in 13th postion with size of 6 characters packed decimal, Here I want to maintain only one trailer in output file with total record count (File1 record count + file2 record count) in packed decimal format
Thanks for reply
I have used your logic like creating sequence number and place in trailer and OVERLAY concept
Modified your JCL to meet my requirement
I am interested to do in one pass.Please let me know how to that
My requirement is
1) Include Header and detaile records and Need to eliminate Trailer from INFILE1
2) Omit Header and include detail & Trailer from INFILE2
3) Total number of record count should be INFILE1 + INFILE2 in Tralier record
I have executed successfully which provide Skolusu
But Is there any way to get total record count from Trailer1 & Trailder 2 like Totatal record count = (Count in Trailer1 + Count in Trailer2)
instead of Creating extra field SEQNUM to get total count
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
vicharapusrinu,
It can be done but it would be inefficient as we have to perform a SORT instead of a copy with sum on the trailer records and eliminate the dups. What is the problem using Seqnum?
The problem is we were creating 2 SEQNUM fields in work file, one for to get record count and the other for to eliminate HDR and TRL.
Heare what I am thinking is creating SEQNUM to eliminate HDR and TRL is fine as those are just 4 records, but creating other SEQNUM field for all records(Sometimes it may be lacs of records) is may not be good