Hi,
I have 2 files. I want to compare them by using a key and if the records are present in either file1 or file2 but not in both files, then I want to write those records to an output file.
I heard that that this can be done through ICETOOL and SPLICE operator.
Please any one tell me how exactly this can be done.
can you please explain what exactly ON(1,10,CH) , WITH(13,1) and
USING(CTL3) refer to?
2)I have 2 files with record length 133.
I want to compare 2 files based on the key Rep-No which is in the disposition 2 in the file and declared as PIC Z9(16).
Please tell me what values I have to use in SPLICE and OUTREC in the later steps?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
ON(1,10,CH) tells SPLICE that the key is a 10-byte character field in positions 1-10. WITH(13,1) tells SPLICE to overlay the byte at position 13 in the overlay record on to the base record at the same position. USING(CTL3) tells SPLICE to use the DFSORT control statements in the //CTL3CNTL data set.
For complete documentation on SPLICE, with lots of examples, see Chapter 6 of "z/OS DFSORT Application Programming Guide". Here's a link:
I don't know what PIC Z9(16) is. If you mean PIC S9(16), that's the equivalent of a 16-byte ZD field. If it starts in position 2, then the ON field would be ON(2,16,ZD).
If you need me to provide the DFSORT/ICETOOL job for you, then you need to give me more information. What is the RECFM and LRECL of the input files? What is the starting position, length and format of the key? Can input file1 have duplicates? Can input file2 have duplicates? Show me an example of the input records in each file, and what you want for the output files. Include duplicates in the example where relevent.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
No, I can't tell you what's wrong with the JCL, because I don't know what your data looks like.
In my previous post, I asked:
Quote:
What is the RECFM and LRECL of the input files? What is the starting position, length and format of the key? Can input file1 have duplicates? Can input file2 have duplicates? Show me an example of the input records in each file, and what you want for the output files. Include duplicates in the example where relevent.
I can't help you until you provide this information.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You didn't show what you wanted the output to look like, as I asked.
Offhand, I see lots of problems with your job such as:
1) You say you have an 11-byte ZD key, but actually the last byte is always blank. It looks like a 10-byte ZD key to me.
2) You have OUTREC FIELDS=(8,11,20:C'11') which moves the key to positions 1-11. But then you use ON(8,11,ZD) instead of ON(1,11,ZD).
3) You use WITH(20,2) instead of WITH(21,1)
4) For some unknown reason, you added:
* MARK FILE3 RECORDS WITH '12'
OUTREC FIELDS=(8,11,20:C'12')
5) You use OUTREC=(2,16) which eliminates the first byte of the key.
I don't know if you want the entire record in the output file or just the key. You showed an example of the IN1 and IN2 records. Now, if you show me what the records should look like in OUT12, OUT1 and OUT2, I can show you the correct DFSORT/ICETOOL job.