not getting desired output using SPLICE



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

not getting desired output using SPLICE

Postby zohaib » Sun Apr 28, 2013 8:16 pm

inp1 -> EE11087.FIDI.UNLOAD.AGPF length (178): key (31:5)
inp2 -> EE11087.FIDI.UNLOAD.ATFK length (66): key (4:5)

i want to match the two files with specified keys and copy field 17:20 of inp2 to inp1 in position 184:20.
Basically I want to add inp2 file field (17:20) to the first file inp1 at end (by key matching)

following code is not working for me:
//*--------------------------------------------------------------------*
//* ICETOOL SPLICE
//*--------------------------------------------------------------------*
//DFSORT   EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=EE11087.FIDI.UNLOAD.AGPF,DISP=SHR
//IN2 DD DSN=EE11087.FIDI.UNLOAD.ATFK,DISP=SHR
//TMP1   DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(1,1)),UNIT=SYSDA
//OUT    DD SYSOUT=*
//TOOLIN DD *
 COPY FROM(IN1) TO(TMP1) USING(CPY1)
 COPY FROM(IN2) TO(TMP1) USING(CPY2)
 SPLICE FROM(TMP1) TO(OUT) ON(1,05,CH) WITH(184,20) WITHALL
/*
//CPY1CNTL DD *

  OUTREC FIELDS=(1:31,5,1,178,205:X)
/*
//CPY2CNTL DD *
  OUTREC FIELDS=(1:4,5,178X,184:17,20,205:X)
/*
//
zohaib
 
Posts: 13
Joined: Sun Apr 28, 2013 7:48 pm
Has thanked: 0 time
Been thanked: 0 time

Re: not getting desired output using SPLICE

 

Re: not getting desired output using SPLICE

Postby NicC » Mon Apr 29, 2013 12:00 am

In what way is it not working? What are the RECFMs of the 2 files?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: not getting desired output using SPLICE

Postby zohaib » Mon Apr 29, 2013 3:58 am

inp1 -> EE11087.FIDI.UNLOAD.AGPF length (178): key (31:5) - RECFM FB
inp2 -> EE11087.FIDI.UNLOAD.ATFK length (66): key (4:5) - RECFM FB

I am not receiving the expected field (17:20) of inp2 at the end of OUT file in pos. 184:20 , there are low-values at the end of OUT file in pos. 184:20



Thanks.
zohaib
 
Posts: 13
Joined: Sun Apr 28, 2013 7:48 pm
Has thanked: 0 time
Been thanked: 0 time

Re: not getting desired output using SPLICE

Postby zohaib » Mon Apr 29, 2013 4:34 am

To better understand you can copy the records in an editor and change font to courier new


EE11087.FIDI.UNLOAD.AGPF (FB - 178) :

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+---
..< .....0000000000056259.ðN CS203.. .......................æS.......j..08 .......34751 FK.....Èq.....d...SPG34751 RS3....æ..................@0....@./â* AFFB30BA
..< .....0000000000010249..N CS177.. ..........&............ðS..........12 .......34935 LE.....çç..æ......98010400 980....ð.................Ø.0...Ø.....10400 EE23988
..< .....0000000000056259.@N CS630.. ..........°...........Ä.S.......j..07 .......34751 C1.....á.<.æ......98010400 980...Ä......°......°.....@0....@./â* AFFB30BA
..< ...Îð0000000000043984.*M CS177.. .........Ø............É.S.......j..12 ....Ø..30463 LE.......@.æ......00010127 020...É.....Ø......Ø.....É.0...É...È*10127 EE08254
..< ....*0000000000014399.*N CS031.. ......................Ø%S.......j..02 .......34796 FP.....çd.....Â*..00010127 070...Ø%.................Ø%0...Ø%..Î.00001 AFMOPER
..< ...`*0000000000010553..N CS203.. ..........Ø.............S........Ê.08 .....Ø.XXXXX KK.....ÏÏ@....Ç...SPGXXXXX 080....@.................k*0....@.â.@10127 EE23237
..< .....0000000000010660..N CS177.. .......................ð ..........12 .......29853 LE.........æ......98010400 980....ð.................Ø.0...Ø...Âæ10400 VH00015
..< ...Ø<0000000000010983..N CS630.. .....................a..S.......j..07 .......34823 C1....éá...æ......98010400 080.....................a..0....@.äë.10127 EE23237
..< ....@0000000000010587..SDPS214.. .........Ø.............%S..-.%.....02 ....Ø..34343 C1.....-.......<..00010127 154....%....Ø......Ø......<0....<.ë.@BTCH ADFB10SE
..< ...çæ0000000000044511.<N CS101.. .......................@S.......j..02 .......34517 C1.....Â.......%..00010127 070....@..................@0....@..&.10127 EE16866



EE11087.FIDI.UNLOAD.ATFK (FB - 66 - it's not seeming long 66 in this format :), you can check in courier new ) :

----+----1----+----2----+----3----+----4----+----5----+----6----+-
..<CS031..... 99 0..°j.09930 US01427 ....
..<CS101..... 99 0..°/*07000 EE07035 ....
..<CS177..... 01 0..°Ê.09930 US01427 ....
..<CS203..... 99 0..-.%9930 US00478 ....
..<CS630..... 01 0..°Êð09930 EE04712 ....
..<PS214..... 99 0..a.*09930 US01427 ....
..<PS214..... 55 0..a.*09930 US01427 ....


Splice OUTPUT (FB - 205):

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+
CS031..< ....*0000000000014399.*N CS031.. ......................Ø%S.......j..02 .......34796 FP.....çd.....Â*..00010127 070...Ø%.................Ø%0...Ø%..Î.00001 AFMOPER ...........................
CS101..< ...çæ0000000000044511.<N CS101.. .......................@S.......j..02 .......34517 C1.....Â.......%..00010127 070....@..................@0....@..&.10127 EE16866 ...........................
CS177..< .....0000000000010249..N CS177.. ..........&............ðS..........12 .......34935 LE.....çç..æ......98010400 980....ð.................Ø.0...Ø.....10400 EE23988 ...........................
CS177..< .....0000000000010249..N CS177.. ..........&............ðS..........12 .......34935 LE.....çç..æ......98010400 980....ð.................Ø.0...Ø.....10400 EE23988 ...........................
CS177..< .....0000000000010249..N CS177.. ..........&............ðS..........12 .......34935 LE.....çç..æ......98010400 980....ð.................Ø.0...Ø.....10400 EE23988 ...........................
CS203..< .....0000000000056259.ðN CS203.. .......................æS.......j..08 .......34751 FK.....Èq.....d...SPG34751 RS3....æ..................@0....@./â* AFFB30BA...........................
CS203..< .....0000000000056259.ðN CS203.. .......................æS.......j..08 .......34751 FK.....Èq.....d...SPG34751 RS3....æ..................@0....@./â* AFFB30BA...........................
CS630..< .....0000000000056259.@N CS630.. ..........°...........Ä.S.......j..07 .......34751 C1.....á.<.æ......98010400 980...Ä......°......°.....@0....@./â* AFFB30BA...........................
CS630..< .....0000000000056259.@N CS630.. ..........°...........Ä.S.......j..07 .......34751 C1.....á.<.æ......98010400 980...Ä......°......°.....@0....@./â* AFFB30BA...........................
PS214..< ....@0000000000010587..SDPS214.. .........Ø.............%S..-.%.....02 ....Ø..34343 C1.....-.......<..00010127 154....%....Ø......Ø......<0....<.ë.@BTCH ADFB10SE...........................



Expected Output (FB - 205):

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+
CS031..< ....*0000000000014399.*N CS031.. ......................Ø%S.......j..02 .......34796 FP.....çd.....Â*..00010127 070...Ø%.................Ø%0...Ø%..Î.00001 AFMOPER 99
CS101..< ...çæ0000000000044511.<N CS101.. .......................@S.......j..02 .......34517 C1.....Â.......%..00010127 070....@..................@0....@..&.10127 EE16866 99
CS177..< .....0000000000010249..N CS177.. ..........&............ðS..........12 .......34935 LE.....çç..æ......98010400 980....ð.................Ø.0...Ø.....10400 EE23988 01
CS177..< .....0000000000010249..N CS177.. ..........&............ðS..........12 .......34935 LE.....çç..æ......98010400 980....ð.................Ø.0...Ø.....10400 EE23988 01
CS177..< .....0000000000010249..N CS177.. ..........&............ðS..........12 .......34935 LE.....çç..æ......98010400 980....ð.................Ø.0...Ø.....10400 EE23988 01
CS203..< .....0000000000056259.ðN CS203.. .......................æS.......j..08 .......34751 FK.....Èq.....d...SPG34751 RS3....æ..................@0....@./â* AFFB30BA 99
CS203..< .....0000000000056259.ðN CS203.. .......................æS.......j..08 .......34751 FK.....Èq.....d...SPG34751 RS3....æ..................@0....@./â* AFFB30BA 99
CS630..< .....0000000000056259.@N CS630.. ..........°...........Ä.S.......j..07 .......34751 C1.....á.<.æ......98010400 980...Ä......°......°.....@0....@./â* AFFB30BA 01
CS630..< .....0000000000056259.@N CS630.. ..........°...........Ä.S.......j..07 .......34751 C1.....á.<.æ......98010400 980...Ä......°......°.....@0....@./â* AFFB30BA 01
PS214..< ....@0000000000010587..SDPS214.. .........Ø.............%S..-.%.....02 ....Ø..34343 C1.....-.......<..00010127 154....%....Ø......Ø......<0....<.ë.@BTCH ADFB10SE 55


Thanks.
zohaib
 
Posts: 13
Joined: Sun Apr 28, 2013 7:48 pm
Has thanked: 0 time
Been thanked: 0 time

Re: not getting desired output using SPLICE

Postby Robert Sample » Mon Apr 29, 2013 5:02 am

change font to courier new
This is wrong. The whole point of the Code button is to preserve spacing and use a fixed width font -- which is better than using Courer New.
EE11087.FIDI.UNLOAD.AGPF (FB - 178) :

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+---
..< .....0000000000056259.ðN CS203.. .......................æS.......j..08 .......34751 FK.....Èq.....d...SPG34751 RS3....æ..................@0....@./â* AFFB30BA
..< .....0000000000010249..N CS177.. ..........&............ðS..........12 .......34935 LE.....çç..æ......98010400 980....ð.................Ø.0...Ø.....10400 EE23988
..< .....0000000000056259.@N CS630.. ..........°...........Ä.S.......j..07 .......34751 C1.....á.<.æ......98010400 980...Ä......°......°.....@0....@./â* AFFB30BA
..< ...Îð0000000000043984.*M CS177.. .........Ø............É.S.......j..12 ....Ø..30463 LE.......@.æ......00010127 020...É.....Ø......Ø.....É.0...É...È*10127 EE08254
..< ....*0000000000014399.*N CS031.. ......................Ø%S.......j..02 .......34796 FP.....çd.....Â*..00010127 070...Ø%.................Ø%0...Ø%..Î.00001 AFMOPER
..< ...`*0000000000010553..N CS203.. ..........Ø.............S........Ê.08 .....Ø.XXXXX KK.....ÏÏ@....Ç...SPGXXXXX 080....@.................k*0....@.â.@10127 EE23237
..< .....0000000000010660..N CS177.. .......................ð ..........12 .......29853 LE.........æ......98010400 980....ð.................Ø.0...Ø...Âæ10400 VH00015
..< ...Ø<0000000000010983..N CS630.. .....................a..S.......j..07 .......34823 C1....éá...æ......98010400 080.....................a..0....@.äë.10127 EE23237
..< ....@0000000000010587..SDPS214.. .........Ø.............%S..-.%.....02 ....Ø..34343 C1.....-.......<..00010127 154....%....Ø......Ø......<0....<.ë.@BTCH ADFB10SE
..< ...çæ0000000000044511.<N CS101.. .......................@S.......j..02 .......34517 C1.....Â.......%..00010127 070....@..................@0....@..&.10127 EE16866

and
EE11087.FIDI.UNLOAD.ATFK (FB - 66 - it's not seeming long 66 in this format , you can check in courier new ) :

----+----1----+----2----+----3----+----4----+----5----+----6----+-
..<CS031..... 99 0..°j.09930 US01427 ....
..<CS101..... 99 0..°/*07000 EE07035 ....
..<CS177..... 01 0..°Ê.09930 US01427 ....
..<CS203..... 99 0..-.%9930 US00478 ....
..<CS630..... 01 0..°Êð09930 EE04712 ....
..<PS214..... 99 0..a.*09930 US01427 ....
..<PS214..... 55 0..a.*09930 US01427 ....
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: not getting desired output using SPLICE

Postby zohaib » Mon Apr 29, 2013 5:37 am

Reformatting records using Code button to preserve spacing.


EE11087.FIDI.UNLOAD.AGPF (FB - 178) :

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+---
..<  .....0000000000056259.ðN CS203..   .......................æS.......j..08  .......34751  FK.....Èq.....d...SPG34751  RS3....æ..................@0....@./â*       AFFB30BA     
..<  .....0000000000010249..N CS177..   ..........&............ðS..........12  .......34935  LE.....çç..æ......98010400  980....ð.................Ø.0...Ø.....10400  EE23988     
..<  .....0000000000056259.@N CS630..   ..........°...........Ä.S.......j..07  .......34751  C1.....á.<.æ......98010400  980...Ä......°......°.....@0....@./â*       AFFB30BA     
..<  ...Îð0000000000043984.*M CS177..   .........Ø............É.S.......j..12  ....Ø..30463  LE.......@.æ......00010127  020...É.....Ø......Ø.....É.0...É...È*10127  EE08254     
..<  ....*0000000000014399.*N CS031..   ......................Ø%S.......j..02  .......34796  FP.....çd.....Â*..00010127  070...Ø%.................Ø%0...Ø%..Î.00001  AFMOPER     
..<  ...`*0000000000010553..N CS203..   ..........Ø.............S........Ê.08  .....Ø.XXXXX  KK.....ÏÏ@....Ç...SPGXXXXX  080....@.................k*0....@.â.@10127  EE23237     
..<  .....0000000000010660..N CS177..   .......................ð ..........12  .......29853  LE.........æ......98010400  980....ð.................Ø.0...Ø...Âæ10400  VH00015     
..<  ...Ø<0000000000010983..N CS630..   .....................a..S.......j..07  .......34823  C1....éá...æ......98010400  080.....................a..0....@.äë.10127  EE23237     
..<  ....@0000000000010587..SDPS214..   .........Ø.............%S..-.%.....02  ....Ø..34343  C1.....-.......<..00010127  154....%....Ø......Ø......<0....<.ë.@BTCH   ADFB10SE     
..<  ...çæ0000000000044511.<N CS101..   .......................@S.......j..02  .......34517  C1.....Â.......%..00010127  070....@..................@0....@..&.10127  EE16866     



EE11087.FIDI.UNLOAD.ATFK (FB - 66 ) :

----+----1----+----2----+----3----+----4----+----5----+----6----+-
..<CS031.....   99                  0..°j.09930  US01427      ....
..<CS101.....   99                  0..°/*07000  EE07035      ....
..<CS177.....   01                  0..°Ê.09930  US01427      ....
..<CS203.....   99                  0..-.%9930   US00478      ....
..<CS630.....   01                  0..°Êð09930  EE04712      ....
..<PS214.....   99                  0..a.*09930  US01427      ....



Splice OUTPUT (FB - 205):

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+
CS031..<  ....*0000000000014399.*N CS031..   ......................Ø%S.......j..02  .......34796  FP.....çd.....Â*..00010127  070...Ø%.................Ø%0...Ø%..Î.00001  AFMOPER ...........................
CS101..<  ...çæ0000000000044511.<N CS101..   .......................@S.......j..02  .......34517  C1.....Â.......%..00010127  070....@..................@0....@..&.10127  EE16866 ...........................
CS177..<  .....0000000000010249..N CS177..   ..........&............ðS..........12  .......34935  LE.....çç..æ......98010400  980....ð.................Ø.0...Ø.....10400  EE23988 ...........................
CS177..<  .....0000000000010249..N CS177..   ..........&............ðS..........12  .......34935  LE.....çç..æ......98010400  980....ð.................Ø.0...Ø.....10400  EE23988 ...........................
CS177..<  .....0000000000010249..N CS177..   ..........&............ðS..........12  .......34935  LE.....çç..æ......98010400  980....ð.................Ø.0...Ø.....10400  EE23988 ...........................
CS203..<  .....0000000000056259.ðN CS203..   .......................æS.......j..08  .......34751  FK.....Èq.....d...SPG34751  RS3....æ..................@0....@./â*       AFFB30BA...........................
CS203..<  .....0000000000056259.ðN CS203..   .......................æS.......j..08  .......34751  FK.....Èq.....d...SPG34751  RS3....æ..................@0....@./â*       AFFB30BA...........................
CS630..<  .....0000000000056259.@N CS630..   ..........°...........Ä.S.......j..07  .......34751  C1.....á.<.æ......98010400  980...Ä......°......°.....@0....@./â*       AFFB30BA...........................
CS630..<  .....0000000000056259.@N CS630..   ..........°...........Ä.S.......j..07  .......34751  C1.....á.<.æ......98010400  980...Ä......°......°.....@0....@./â*       AFFB30BA...........................
PS214..<  ....@0000000000010587..SDPS214..   .........Ø.............%S..-.%.....02  ....Ø..34343  C1.....-.......<..00010127  154....%....Ø......Ø......<0....<.ë.@BTCH   ADFB10SE...........................




Expected Output (FB - 205):

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+
CS031..<  ....*0000000000014399.*N CS031..   ......................Ø%S.......j..02  .......34796  FP.....çd.....Â*..00010127  070...Ø%.................Ø%0...Ø%..Î.00001  AFMOPER      99                   
CS101..<  ...çæ0000000000044511.<N CS101..   .......................@S.......j..02  .......34517  C1.....Â.......%..00010127  070....@..................@0....@..&.10127  EE16866      99                   
CS177..<  .....0000000000010249..N CS177..   ..........&............ðS..........12  .......34935  LE.....çç..æ......98010400  980....ð.................Ø.0...Ø.....10400  EE23988      01                   
CS177..<  .....0000000000010249..N CS177..   ..........&............ðS..........12  .......34935  LE.....çç..æ......98010400  980....ð.................Ø.0...Ø.....10400  EE23988      01                   
CS177..<  .....0000000000010249..N CS177..   ..........&............ðS..........12  .......34935  LE.....çç..æ......98010400  980....ð.................Ø.0...Ø.....10400  EE23988      01                   
CS203..<  .....0000000000056259.ðN CS203..   .......................æS.......j..08  .......34751  FK.....Èq.....d...SPG34751  RS3....æ..................@0....@./â*       AFFB30BA     99                   
CS203..<  .....0000000000056259.ðN CS203..   .......................æS.......j..08  .......34751  FK.....Èq.....d...SPG34751  RS3....æ..................@0....@./â*       AFFB30BA     99                   
CS630..<  .....0000000000056259.@N CS630..   ..........°...........Ä.S.......j..07  .......34751  C1.....á.<.æ......98010400  980...Ä......°......°.....@0....@./â*       AFFB30BA     01                   
CS630..<  .....0000000000056259.@N CS630..   ..........°...........Ä.S.......j..07  .......34751  C1.....á.<.æ......98010400  980...Ä......°......°.....@0....@./â*       AFFB30BA     01                   
PS214..<  ....@0000000000010587..SDPS214..   .........Ø.............%S..-.%.....02  ....Ø..34343  C1.....-.......<..00010127  154....%....Ø......Ø......<0....<.ë.@BTCH   ADFB10SE     55                   


Why i am not getting the expected result ??

Thanks.
zohaib
 
Posts: 13
Joined: Sun Apr 28, 2013 7:48 pm
Has thanked: 0 time
Been thanked: 0 time

Re: not getting desired output using SPLICE

Postby BillyBoyo » Mon Apr 29, 2013 11:47 am

Please don't send messages to people asking them to look at your question.

Look at using JOINKEYS instead of SPLICE. For this example. you do not need SPLICE.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: not getting desired output using SPLICE

Postby zohaib » Mon Apr 29, 2013 1:15 pm

Thanks for your reply, i am already using JOINKEYS and it's working fine. My question is why it's not working with SPLICE.
My case is similar to this one: (link to competitor site removed)And it worked with SPLICE. What's wrong in my JCL ?
zohaib
 
Posts: 13
Joined: Sun Apr 28, 2013 7:48 pm
Has thanked: 0 time
Been thanked: 0 time

Re: not getting desired output using SPLICE

Postby dick scherrer » Mon Apr 29, 2013 9:48 pm

Hello,

We do not allow posting competitor site links . . .

Thank you.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: not getting desired output using SPLICE

Postby skolusu » Mon Apr 29, 2013 10:56 pm

hmm competitor site links ? oh well

zohaib,

You need to understand how splice works. The overlaying record should be the first record. so try these untested control cards.

//TOOLIN DD *                                               
 COPY FROM(IN2) TO(TMP1) USING(CPY2)                       
 COPY FROM(IN1) TO(TMP1) USING(CPY1)                       
 SPLICE FROM(TMP1) TO(OUT) ON(1,05,CH) WITH(6,178) WITHALL   
//*


PS: Zohaib please do NOT send private messages seeking help. I do not check the board on weekends.
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post