2023 2024 Student Forum > Management Forum > Main Forum

 
  #1  
10th February 2017, 12:10 PM
Unregistered
Guest
 
Icetool Splice On

Hi I am interested in having the utilization of SPLICE for Application Programming Guide as well as what the various ICETOOL operators do in Create one spliced record for each match in two files job?
  #2  
10th February 2017, 02:09 PM
Super Moderator
 
Join Date: Mar 2013
Re: Icetool Splice On

SPLICE typically requires reformatting the records of at least two informational indexes so they can be joined, so total JCL cases are appeared in this segment to show the recommended strategies. These procedures what's more, others can be utilized with SPLICE to play out an assortment of undertakings.

Since SPLICE overlays the WITH fields from the overlay record to the construct record utilizing coordinating With respect to fields, it's generally essential to do some underlying setup before utilizing SPLICE, to guarantee that:

The ON fields are in similar positions in the base and overlay records

The WITH fields in the overlay records are in the positions they will involve in the base records

The base records and overlay records are a similar length. This is constantly required for settled length records, and is required for variable-length Records unless VLENMAX or VLENOVLY is indicated.

For ideal proficiency, it is likewise a smart thought to evacuate any records that are not required for the SPLICE operation as a component of the underlying setup before the SPLICE operation, by utilizing fitting include or omit statements.

Splices together determined fields from records with coordinating numeric or character field values (that is, copy values), however extraordinary data. This makes it conceivable to join fields from various sorts of information records to make a yield record with data from at least two records.

Regularly, you will need to reformat the records from at least two informational collections to a brief MOD informational collection, and utilize that transitory MOD informational index as contribution to the SPLICE administrator.

Graft illustrations demonstrates a few methods for grafting records from various informational indexes together in an assortment of approaches to perform different document "join" and "match" operations.

Example - Create one spliced record for each match in two files

This example shows how you can splice data together for each pair of records with the same ON field in two different input data sets.
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
Y12 89503 MKT
Y12 57301 MKT
Z35 02316 DEV
Y12 91073 MKT
Z35 18693 DEV
/*
//IN2 DD *
89503 27M $9,185,354 SAN JOSE CA
72135 08M $317,632 BOSTON MA
18693 10M $8,732,105 BUFFALO NY
57301 50M $30,000 NEWARK NJ
/*
//TEMP1 DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT =SYSDA
//COMBINE DD SYSOUT=*
//TOOLIN DD *
* Reformat the File1 records for splicing
COPY FROM(IN1) TO(TEMP1) USING(CTL1)
* Reformat the File2 records for splicing
COPY FROM(IN2) TO(TEMP1) USING(CTL2)
* Splice the needed data from File1 and File2 together
SPLICE FROM(TEMP1) TO(COMBINE) ON(5,5,ZD) WITH(15,17)
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1,14, file1 data
31:X) add blanks for spliced file2 data
/*
//CTL2CNTL DD *
OUTREC FIELDS=(5:1,5, put file2 key in same place as file1 key
15:7,15, file2 data
30:33,2) file2 data
/*
The base records originate from the IN1 data set and are copied and reformatted to the TEMP1 data set. The reformatted TEMP1 records are 31 bytes long and look like this:
Y12 89503 MKT
Y12 57301 MKT
Z35 02316 DEV
Y12 91073 MKT
Z35 18693 DEV
The overlay records originate from the IN2 data set and are copied and reformatted to the end (MOD) of the TEMP1 data set. The reformatted TEMP1 records are 31 bytes long and look like this:
89503 27M $9,185,354 CA
72135 08M $317,632 MA
18693 10M $8,732,105 NY
57301 50M $30,000 NJ
Note that MOD is used for the TEMP1 data set, so the reformatted records from IN1 and IN2 will be output to the TEMP1 data set in that order, ensuring that they are spliced in that order.
The base and overlay records from the TEMP1 data set are sorted and spliced to the COMBINE data set.
The records look like this after they are sorted on the 5,5,ZD field, but before they are spliced. As a visual aid, the WITH fields in the overlay records are shown in bold.
Z35 02316 DEV
Z35 18693 DEV
18693 10M $8,732,105 NY
Y12 57301 MKT
57301 50M $30,000 NJ
72135 08M $317,632 MA
Y12 89503 MKT
89503 27M $9,185,354 CA
Y12 91073 MKT
The spliced COMBINE records are 31 bytes long and look like this:
Z35 18693 DEV 10M $8,732,105 NY
Y12 57301 MKT 50M $30,000 NJ
Y12 89503 MKT 27M $9,185,354 CA
Note that the base records for 18693, 57301 and 89503 have been spliced together with their respective overlay records.

Here is the thing that the different ICETOOL administrators do in this occupation:

The principal COPY administrator makes reformatted IN1 records in TEMP1. The second COPY administrator makes reformatted IN2 records in TEMP1. The reformatted IN1 records have spaces where the reformatted IN2 WITH fields will go. The reformatted IN2 records have the ON field from IN2 in an indistinguishable place from in the reformatted IN1 records, and have the IN2 information where we need it to go in the reformatted IN1 records. It made the reformatted IN1 and reformatted IN2 records a similar size so we can put them all in the TEMP1 informational collection and utilize TEMP1 as info to the SPLICE administrator.

The SPLICE administrator sorts the records from TEMP1 utilizing the ON field. TEMP1 has the reformatted IN1 records before the reformatted IN2 records. The joined records are made from the base records furthermore, the overlay records in TEMP1. At whatever point two records are found with the same ON field, the WITH field from the second record (reformatted IN2 overlay record) is overlaid on to the main record (reformatted IN1 base record). The subsequent joined records are composed to the Join informational collection.


Quick Reply
Your Username: Click here to log in

Message:
Options




All times are GMT +5. The time now is 07:43 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
SEO by vBSEO 3.6.0 PL2

1 2 3 4