Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SPLICE option in ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
jsnair

New User


Joined: 26 Sep 2006
Posts: 38
Location: India

PostPosted: Thu May 29, 2008 12:11 pm    Post subject: SPLICE option in ICETOOL
Reply with quote

Hi,

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.

Code:
//TOOLIN  DD *                                                   
 COPY FROM(IN1) TO(T1) USING(CTL1)                               
 COPY FROM(IN2) TO(T1) USING(CTL2)                               
 SPLICE FROM(T1) TO(OUT12) ON(1,1,CH) WITH(13,1) USING(CTL3) -   
 KEEPNODUPS                                                     
/*                                                               
//CTL1CNTL DD *                                                 
  INREC OVERLAY=(12:C'11')                                       
/*                                                               
//CTL2CNTL DD *                                                 
  INREC OVERLAY=(12:C'22')                                       
/*                                                               
//CTL3CNTL DD *                                                 
 OUTFIL FNAMES=OUT12,INCLUDE=(12,2,CH,EQ,C'12'),BUILD=(1,10,70X)
 OUTFIL FNAMES=OUT1,INCLUDE=(12,2,CH,EQ,C'11'),BUILD=(1,10,70X) 
 OUTFIL FNAMES=OUT2,INCLUDE=(12,2,CH,EQ,C'22'),BUILD=(1,10,70X) 
/* 



From the above code I can understand the COPY statements in TOOLIN but quite confused with the SPLICE statement.
Back to top
View user's profile Send private message

mgl

New User


Joined: 12 Dec 2005
Posts: 27
Location: Belgium

PostPosted: Thu May 29, 2008 5:40 pm    Post subject:
Reply with quote

Hi,

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

http://www.ibm.com/storage/dfsort/

you will found some document done by Mr Yaeger (IBM DFSORT developer for a long time) giving a lot of explonation and examples.

Hope this help,
best regards
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu May 29, 2008 9:04 pm    Post subject:
Reply with quote

Jiji,

For more explanation on that SPLICE example, see the "Create files with matching and non-matching records" Smart DFSORT Trick at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/

For complete information on the SPLICE operator of DFSORT's ICETOOL, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.13?DT=20060615185603
Back to top
View user's profile Send private message
jsnair

New User


Joined: 26 Sep 2006
Posts: 38
Location: India

PostPosted: Fri May 30, 2008 12:06 pm    Post subject: Reply to: SPLICE option in ICETOOL
Reply with quote

Hi mgl,

Thanx for you time to explain this.

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)).
Back to top
View user's profile Send private message
mgl

New User


Joined: 12 Dec 2005
Posts: 27
Location: Belgium

PostPosted: Fri May 30, 2008 1:08 pm    Post subject:
Reply with quote

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.

Best regards,
Michel.
Back to top
View user's profile Send private message
jsnair

New User


Joined: 26 Sep 2006
Posts: 38
Location: India

PostPosted: Fri May 30, 2008 5:25 pm    Post subject:
Reply with quote

Now I cleared my doubts. The links provided by Frank is excellent. Thanx to Michel and Frank.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us