I am new to ICETOOL and trying to get an idea about the SPLICE option. I was going thru some material and came across the below mentioned code. I was little confused with this. Could anybody please explain me the same.
Here it will take 2 input files and create files with matching and non-matching records.
With this job, you copy records from file 1 in a temporary file, and you overlay position 12 and 13 of each records with 2 '1'. You copy file 2 in the same file but you overlay position 12 and 13 with 2 "2"
The splice command copy records FROM input file (T1) TO output file(out12). If the key of the next records is the same (ON(1,1,,CH)), you overlay position 13 of the first records with the content of position 13 from the next record and delete next record(WITH(13,1)). You copy also the records were key is unique in the input file (KEEPNODUPS). Output records are also modified in accordance of the sort instruction contained in dataset represented by ddname CTL3CNTL (USING(CTL3)).
Splice works only with a single input file (may be a concatenation of file of course). You copy the records from 2 separate files in one file and mark them with a label in order to be able to recognize the origin of the records (the 11 for file 1 and the 22 for file 2). With the splice you replace in the records with the same key the second character of the label introduced previously and you keep all records not duplicated with the original label.
In result you will copy only records first records from duplicated records and all non duplicated records. Records from file one not duplicated or duplicated only in file one will have a label of 11. Records not duplicated from file2 or duplicated only in file 2 will have a label of 22. And records from file 1 duplicated in file 2 will have a label of 12.
With the dfsort statement you split your output in 3 files in accordance with the label, and you take only the 10 first position and pad your records with 70 blanks (probably to force FB 80 ).
DFSORT's ICETOOL allow you to do a lot more thing with your data. If you go to the IBM DFSORT site at
The initial part(upto temp file creation) I am very much clear. We will get a temp file like below.
Code:
****** ***************************** Top of Data ***************
000001 Vicky 11
000002 Frank 11
000003 Carrie 11
000004 Holly 11
000005 David 11
000006 Karen 22
000007 Holly 22
000008 Carrie 22
000009 Vicky 22
000010 Mary 22
****** **************************** Bottom of Data *************
The splice command copy records FROM input file (T1) TO output file(out12).
My doubt comes here. As mentioned below what will be the key?.
Quote:
If the key of the next records is the same (ON(1,1,,CH)), you overlay position 13 of the first records with the content of position 13 from the next record and delete next record(WITH(13,1)).
Hello,
The "key" is the data described by the ON sub-parameter. In this case 1,1,CH that means first character of the record.
In the temp file you will have the complate records like it is on the input file except characters 12 and 13 overlayed by the value indicated in the copy statement.
But, as stated by Mr Yaeger, i beleive that a visit on the dfsort site will help you a lot more than all explonation catched here.