If the field2 in File1('ABC') matches with field1 in File2, then replace field2 in File1 with field2 in File2('XYZ'). The out file should look like below,
Ouput
--------------------
123;XYZ;@@@
Both the input files will have at least one occurance of the key and both the files are sorted based on Key.
I dont have support for JOINKEYS command since my DFSORT is old version. Is there any other way in DFSORT we can do this.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You need to give more information before I can help you.
What is the RECFM and LRECL of the input files?
Are the fields always three bytes long or are they real delimited fields that can have different lengths in different records? If different lengths, what is the maximum length for each field?
The key in File1 is the second delimited field and the key in File2 is the first delimited field?
Please show a better example of the records in each input file (relevant fields only) with matching and non-matching fields, and what you expect for output. Explain the "rules" for getting from input to output. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
The key position in file2 is from 1 to 11 and the key is fixed length
There are no duplicates in both the files..
The output file LRECL and RECFM will be same as file1 and if the keys match replace the position 10 to 20 in file1 with values from position 12 to 22 in file2 and the output file will look like below,