MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SPLICE issue in ICETOOL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Wed Jan 04, 2017 6:42 am    Post subject: SPLICE issue in ICETOOL Reply with quote

Hi All,

Can you please help me on below issue.

Below is my input file and desired output file but after running below ICETOOL step I am not getting desired output. Can you please look into below and let me know how can we achieve this.


Input file(FB/41)

Code:

=COLS> ----+----1----+----2----+----3----+----4--
000012 F2016-12-30   1 E-CERT IS IN WAIT STATUS 
000013 F2016-12-30   3 N-CERTS ARE IN WAIT STATUS
000014 F2016-12-31   1 N-CERT IS IN WAIT STATUS 
000015 G2016-12-30   1 E-CERT IS IN SENT STATUS 
000016 G2016-12-30   8 N-CERTS ARE IN SENT STATUS
000017 G2016-12-31  40 N-CERTS ARE IN SENT STATUS
000018 G2017-01-01  16 N-CERTS ARE IN SENT STATUS
000019 G2017-01-02  16 N-CERTS ARE IN SENT STATUS
000020 C2016-12-31   3 N-CERTS ARE IN WAIT STATUS
000021 C2016-12-31   2 E-CERTS ARE IN SENT STATUS



Desired Output File(FB/72)

Code:

=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7---
****** ***************************** Top of Data *******************************
000010 DATE       F                    G                    C                   
000100 2016-12-30 0001 E-CERT IN WAIT  0001 E-CERT IN WAIT                     
000200 2016-12-30 0003 N-CERTS IN WAIT 0008 N-CERTS IN SENT                   
000300 2016-12-31 0001 N-CERT IN WAIT  0040 N-CERTS IN SENT 0003 N-CERTS IN WAIT
000400 2016-12-31                                           0002 E-CERTS IN SENT
000500 2017-01-01                      0016 N-CERTS IN SENT                   
000600 2017-02-01                      0016 N-CERTS IN SENT                   
****** **************************** Bottom of Data *****************************



JCL


Code:

//STEP0020 EXEC PGM=ICETOOL                                             
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN       DD *                                                         
F2016-12-30   1 E-CERT IN WAIT                                         
F2016-12-30   3 N-CERTS IN WAIT                                         
F2016-12-31   1 N-CERT IN WAIT                                         
G2016-12-30   1 E-CERT IN SENT                                         
G2016-12-30   8 N-CERTS IN SENT                                         
G2016-12-31  40 N-CERTS IN SENT                                         
G2017-01-01  16 N-CERTS IN SENT                                         
G2017-01-02  16 N-CERTS IN SENT                                         
C2016-12-31   3 N-CERTS IN WAIT                                         
C2016-12-31   2 E-CERTS IN SENT                                         
/*                                                                     
//OUT      DD SYSOUT=*                                                 
//TOOLIN   DD *                                                         
   SPLICE FROM(IN) TO(OUT) ON(2,10,CH) WITHANY USING(CTL1)          -   
   KEEPNODUPS WITH(12,20) WITH(34,20) WITH(58,20)                       
//*                                                                     
//CTL1CNTL DD *                                                         
   OPTION COPY                                                         
   INREC IFOUTLEN=97,                                                   
   IFTHEN=(WHEN=INIT,BUILD=(1:2,10,97:12,20,117:1,1)),                 
   IFTHEN=(WHEN=(117,1,CH,EQ,C'F'),OVERLAY=(12:97,20)),                 
   IFTHEN=(WHEN=(117,1,CH,EQ,C'G'),OVERLAY=(33:97,20)),                 
   IFTHEN=(WHEN=(117,1,CH,EQ,C'C'),OVERLAY=(57:97,20))                 
/*                                                                     



Output after running job


Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8

********************************* TOP OF DATA **********************************
2016-12-30    3 N-CERTS IN WAIT                                                 
2016-12-31    1 N-CERT IN WAIT                                                 
2016-12-30                         8 N-CERTS IN SENT                           
2016-12-31                        40 N-CERTS IN SENT                           
2017-01-01                        16 N-CERTS IN SENT                           
2017-01-02                        16 N-CERTS IN SENT                           
2016-12-31                                                 2 E-CERTS IN SENT   
******************************** BOTTOM OF DATA ********************************

 


Thanks,
Siva
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Wed Jan 04, 2017 10:55 am    Post subject: Reply with quote

sivafdms,

Did you notice this ?

Code:

//CTL1CNTL DD *                                                         
   OPTION COPY 


This will override the SORT FIELDS=(2,10,CH) you had on SPLICE and hence the wrong results since your data is NOT sorted on the date.

Even if you remove that you would still not get the right results as you want to duplicate results on the date.

SPLICE creates a single records by joining fields from different types of input records to create an output record with information from two or more records. The first duplicate is treated as a "base record". The last duplicate is treated as an "overlay record". Specified fields from the overlay record are overlaid on to the base record. Thus, the output record consists of fields from the base (first) record intermixed with specified fields from the overlay (last) record.

So Splice is not the right operator for you in this case unless you tag the second set of records as a different key.
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group