Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Well, you haven't explained what it is you need. You just showed us some code and some results without any context.
Please start over and give a good example of the records in each input file and what you expect for each output file. Explain the "rules" for getting from input to output.
Do you really want three output files or do you actually want one output file but didn't know how to get it?.
Give the RECFM and LRECL of the input files. Give the starting position, length and format of each relevant field.
I suspect there's a better way to do what you want, but I'd have to know what you're trying to do before I could help you.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
It would make it more clear if you would actually explain the "rules" you want to use for getting from input to output. What you want seems to have something to do with the 3rd field in the files, but you haven't said anything about a condition involving that 3rd field.
Quote:
But I am not able to elimanate the record which is having a match
A match on what? You talk about the two keys, but the 3rd field seems to be involved too. How?
In your latest example, the first 4 records all match by your two keys. The first 3 records have UPDATE for the 3rd field in file1 and blanks for the 3rd field in file2. The 4th record has UPDATE for the 3rd field in file1 and UPDATE for the 3rd field in file2. You seem to want the first 3 records in OUT12 but not the 4th record. But you haven't ever explained what the "rules" are for doing that. Do you want to eliminate records which match on the key fields AND the 3rd field? Or do you want something else? You really need to explain what you want to do.
Also, what is the starting position and length of the 3rd field?