icetool and splice option

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
4ubobby
Member
Posts: 19
Joined: Fri Nov 06, 2009 7:49 pm
Location: USA

icetool and splice option

Post by 4ubobby » Fri Nov 06, 2009 8:19 pm

Hi,

Can anyone explain me about the with option in the splice. I have followed a lot of links given by frank.. i was not able to understand it. I have tried using icetool which has satisifed by requirement however i did not exactly understand why the with option is used.

Can someone explain me the below code thanks very much in advance...

I have 2 input files of record length 80 containing first 10 bytes as key in both the files

i want the records which are present in input 1 and not present in input2

here is the splice which i have copied from one of the threads and it worked.

COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT1) ON(81,10,CH) WITH(91,1) -
USING(CTL3) KEEPNODUPS

can someone explain me about the use of with option here...what extractly it does
thanks

Bobby

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Fri Nov 06, 2009 9:32 pm

That SPLICE statement will overlay position 91 from the last record with each key on to the base record for each key. For example, if you had these input records:

Code: Select all

        81        91
        |         |
AAA ... KEY1      XY     <-- base for KEY1
BBB ... KEY1      QR     <-- overlay for KEY1
DDD ... KEY2      RS     <-- base for KEY2
EEE ... KEY2      MN     <-- overlay for KEY2
CCC ... KEY2      PQ     <-- overlay for KEY2
You would get these output records:

Code: Select all

        81        91
        |         |
AAA ... KEY1      QY
DDD ... KEY2      PS
Notice that output record 1 has all of the data from the base (first) record for KEY1, with position 91 (Q) from the last overlay record. Output record 2 has all of the data from the base record for KEY2, with position 91 (P) from the last overlay record.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

4ubobby
Member
Posts: 19
Joined: Fri Nov 06, 2009 7:49 pm
Location: USA

icetool and splice option

Post by 4ubobby » Fri Nov 06, 2009 11:15 pm

Hi frank,

here is the complete jcl step.

Code: Select all

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=TF9757T.BMPP3.SOHPEXT.OUTPUT,DISP=SHR----input  1
//IN2 DD DSN=TF9757T.SPUFI.OUT,DISP=SHR-----input2
//OUT1 DD DSN=TF9757T.NTFOUND.FILE1,UNIT=SYSDA,-----output 1
//            DISP=&#40;NEW,CATLG,CATLG&#41;,
//            SPACE=&#40;CYL,&#40;20,20&#41;&#41;,
//            DCB=&#40;RECFM=FB,LRECL=80&#41;
//OUT2 DD DSN=TF9757T.NTFOUND.FILE2,UNIT=SYSDA,------output2
//            DISP=&#40;NEW,CATLG,CATLG&#41;,
//            SPACE=&#40;CYL,&#40;20,20&#41;&#41;,
//            DCB=&#40;RECFM=FB,LRECL=80&#41;
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=&#40;CYL,&#40;20,20&#41;&#41;,DISP=&#40;MOD,PASS&#41;
//TOOLIN DD *
COPY FROM&#40;IN1&#41; TO&#40;T1&#41; USING&#40;CTL1&#41;
COPY FROM&#40;IN2&#41; TO&#40;T1&#41; USING&#40;CTL2&#41;
SPLICE FROM&#40;T1&#41; TO&#40;OUT1&#41; ON&#40;81,10,CH&#41; WITH&#40;91,1&#41; -
USING&#40;CTL3&#41; KEEPNODUPS
/*
//CTL1CNTL DD *
  OUTREC FIELDS=&#40;1,80,81&#58;1,10,91&#58;C'11'&#41;
/*
//CTL2CNTL DD *
  OUTREC FIELDS=&#40;1,80,81&#58;1,10,91&#58;C'22'&#41;
/*
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT1,INCLUDE=&#40;91,2,CH,EQ,C'11'&#41;,OUTREC=&#40;1,80&#41;
  OUTFIL FNAMES=OUT2,INCLUDE=&#40;91,2,CH,EQ,C'22'&#41;,OUTREC=&#40;1,80&#41;
/*
In the above example, the key in both the fields is 1 to 10,

file 1 format
**********

F2685110|TBA-155400 |0981113|B|
F2685210|TBA-155401 |0981203|B|
7457600|228D5330G0003 |1090309|B|
7145830|211D1137P0001 |1070110|B|

file 2 format
**********
F2685110
F2685210

i have understood that both the records from the input files are copied into 1 to 80 bytes of t1 and after that 81 to 10 bytes of t1 file have the key

why the with option is used here which is checking from (91,1) what is the use of it.. i think we have moved c'11' and c'22' in t1 at that position.

Looks like a layman question. However i did not get why with option.
thanks

Bobby

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Fri Nov 06, 2009 11:35 pm

We put '11' at 91-92 for the base (file1) records. We put '22' at 91-92 for the overlay (file2) records. With WITH(91,1), SPLICE gives us an 'id' in 91-92 consisting of '11' for records only in file1, '22' for records only in file2, or '12' for records in file1 and file2. Then we can use a test of what's in 91-92 for OUTFIL INCLUDE to determine where each record goes.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

4ubobby
Member
Posts: 19
Joined: Fri Nov 06, 2009 7:49 pm
Location: USA

icetool and splice option

Post by 4ubobby » Fri Nov 06, 2009 11:46 pm

Frank,

thanks for the quick reply...

So the WITH option is to differentiate the records from the 2 input files it does not matter whether you give (91,1) or 91,2) it would actually depend upon the

//CTL1CNTL DD *
OUTREC FIELDS=(1,80,81:1,10,91:C'11')

Please correct me if am wrong in my case i can use (91,1) or (91,2). both give me the same output...
thanks

Bobby

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Fri Nov 06, 2009 11:59 pm

Please correct me if am wrong in my case i can use (91,1) or (91,2). both give me the same output...
In your case, since you are not checking for '12', you can use WITH(91,1) or WITH(92,1). WITH(91,2) wouldn't be correct - I assume you meant WITH(92,1).
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

4ubobby
Member
Posts: 19
Joined: Fri Nov 06, 2009 7:49 pm
Location: USA

icetool and splice option

Post by 4ubobby » Sat Nov 07, 2009 1:51 am

hi frank,

I am sorry i am really not able to get on with WITH option. Could you please give me a link where it explains only about the WITH option and if you can provide some example only for the with option.....that would be gr8
thanks

Bobby

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Mon Nov 09, 2009 9:50 pm

I really don't know how else to help you. The WITH option is explained in the DFSORT books in the context of the SPLICE option, not by itself. Likewise for examples. I don't really understand why you are not able to "get on with WITH option". I thought I did a pretty good job of explaining it in this thread. I don't know how else to explain it that will help you if you don't understand what I've explained already.

Here's a link to the explanation of the SPLICE operand. Perhaps if you read through the entire explanation and try to understand all of the provided examples, you'll get it:

http://publibz.boulder.ibm.com/cgi-bin/ ... 0527161936
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others