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 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
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Thank you vinuk2009.
It is a fairly simple JOINKEYS.
Specify the key for each file on the JOINKEYS statement. If the files are already sorted, specify SORTED,NOSEQ on the JOINKEYS statement. If not sorted, they will be sorted by default.
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.
Can anyone help me out, File 1 data is not getting overlayed with file2 data
i could see in spool number of matched records and mismatched records but for matched records data in FILE1 is not getting replaced by file2
Can someone please correct me or suggest
//**REQUIREMENT: FOR ALL MATCHING RECORDS OF FILE2,UPDATE FILE 1 DATA AT POSITION 24:8 BY PICKING VALUES FROM FILE2 FROM POSITION 16:8
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.
Dear Moderators,
I believe the questions of this type: "How can I start doing my own job?" - must be prohibited at the Expert Forum.
The only questions allowed are:
- I tried to do <this>, and <this>
- I use this tool to achieve my goal
- I expected results like <this>, and <this>
- I've got the result like <this>, and/or messages/errors like <this>
- Please clarify for me the reason of bad results
Instead, again and again there are messages in the style
- Please, perform my job duties for me! I have no idea where to start from...
Those trying to ask these questions must be banned, I think.
sergeyken, This is 7 years old post. What you raised is totally a different topic which has been discussed in past several times... So far it difficult to control such posts appearing it here than Beginners Forum.
vinkum, Please don't tailgate any post , specially too old ones. Start a new one with your requirements and make a use of Code tags.
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
Vinkum - apart from tailgating someone else's topic, posting to an old topic and not using the code tags you have posted in the DFSort part of the formum when you are using Syncsort.