I have two fixed length files. file1 has record length 80 and file2 has record length 600. I need to compare these two files and replace file2 values file1 values if the key in file1 match with key in file2. key in file1 starts from 10 and ends at 18. key in file2 starts from 6 and ends at 14. I need to replace file2 values start from 20 to 28 with file1 values start from 1 to 9 if the file1 key matches with file2 key otherwise we need not to replace. Also I need to keep header and trailer of file2 as it is. header record is first record on the file and trailer record is last record in the file. Could some one please help me in achieving this result.
Sorry for late response. I have executed your sort job and the information of DFSORT from the sysout is as follows. I believe you are looking for this information.
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND,MORE
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 01:52 ON WED SEP 05, 2012 -
0 OPTION COPY 00001601
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1
I'm assuming that the file 1 can never match a header/trailer record; that you want all unmatch file 2 records on your output file; that you are unconcerned about unmatched file 1 records; you are not really "comparing" the recors, but joining/matching on the key fields.
The header/trailer point that you brought up is a red-herring, unless there is more you are not telling.