Joined: 03 Feb 2007 Posts: 175 Location: PUNE(INDIA)
if the key positions are different , then how to compare two files in SPLICE option.
You will have to arrange the keys on common location.
Useually, we do following.
Copy file A to a temporary MOD file (say TEMP1)
Copy file B to same temporary file TEMP1, rearranging the fields to have key in file B to appear at same location as of key of file A.
A programer has to identify a location in TEMP file at which keys from both the files can be arranged !
There are many ways to use SPLICE. How exactly you would use it depends on what you're trying to do. If you need more specific help, show an example of the records in your input files (relevant fields only) and what you expect for the output records. If input file1 has duplicates within it, show that in your example. If input file2 has duplicates, show that in your example. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files.
If you want to try to figure it out yourself, see the DFSORT documentation on SPLICE at: