Download DFSORT PTF UQ90053 User Guide

Transcript
Example 3 - Create multiple spliced records for each match in two files
This example shows how you can use the WITHALL operand to tell ICETOOL to splice data together for a record
from one data set (the first data set) and multiple records from another data set (the second data set) that all have
the same ON field (duplicate records). It also shows how to ensure that duplicates from the second data set without
a match in the first data set are not written to the output data set.
+---------------------------------------------------------------------+
| //S3
EXEC PGM=ICETOOL
|
| //TOOLMSG
DD SYSOUT=+
|
| //DFSMSG
DD SYSOUT=+
|
| //MAST DD +
|
| A----B----KRSC----D------E----F--G--|
| A1111B1111FLYC1111D111111E1111F11G111
|
| /+
|
| //UPD DD +
|
| H-2KRSI-----2J--2K--2L-2
|
| H-3FLYI-----3J--3K--3L-3
|
| H-4VQXI-----4J--4K--4L-4
|
| H-5FLYI-----5J--5K--5L-5
|
| H-6KHNI-----6J--6K--6L-6
|
| H-7KRSI-----7J--7K--7L-7
|
| H-8FLYI-----8J--8K--8L-8
|
| H-9KHNI-----9J--9K--9L-9
|
| /+
|
| //TEMP1 DD DSN=&&TEMP1,DISP=(,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
|
| //TEMP2 DD DSN=&&TEMP2,DISP=(,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
|
| //CONCAT DD DSN=+.TEMP1,VOL=REF=+.TEMP1,DISP=(OLD,PASS)
|
| //
DD DSN=+.TEMP2,VOL=REF=+.TEMP2,DISP=(OLD,PASS)
|
| //OUT DD SYSOUT=+
|
| //TOOLIN
DD +
|
| + Reformat the File1 records for splicing.
|
| + Add 'B' identifier for base records.
|
| COPY FROM(MAST) TO(TEMP1) USING(CTL1)
|
| + Reformat the File2 records for splicing. Add 'V' identifier.
|
| + Add 'V' identifier for overlay records.
|
| COPY FROM(UPD) TO(TEMP2) USING(CTL2)
|
| + Splice needed base and overlay data together.
|
| + Do NOT splice identifier.
|
| SPLICE FROM(CONCAT) TO(OUT) WITH(1,7) WITH(13,4) ON(2-,3,CH) |
|
WITH(23,3) WITH(26,3) WITHALL USING(CTL3)
|
| /+
|
| //CTL1CNTL DD +
|
| + Set up fields in base records. Add 'B' id in position 33.
|
|
OUTREC FIELDS=(8:14,5,17:31,3,2-:11,3,29:34,4,33:C'B')
|
| /+
|
| //CTL2CNTL DD +
|
| + Set up fields in overlay records. Add 'V' id in position 33.
|
|
OUTREC FIELDS=(1:7,7,13:18,4,2-:4,3,23:1,3,26:22,3,33:C'V')
|
| /+
|
| //CTL3CNTL DD +
|
| + Remove duplicate overlay records without matching base record.
|
| + Remove base or overlay indicator.
|
|
OUTFIL FNAMES=OUT,OMIT=(33,1,CH,EQ,C'V'),OUTREC=(1,32)
|
| /+
|
+---------------------------------------------------------------------+
DFSORT PTF UQ90053 User Guide
15