IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Join multiple records using splice


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Roger Booth

New User


Joined: 17 Jul 2023
Posts: 3
Location: United States

PostPosted: Mon Jul 17, 2023 10:53 pm
Reply with quote

Hello,
My first post.
I have looked at the splice posts over and over, and I can't seem to get it correct. I have 100 byte records. Key is in byte 1 thru 8. I just want to completely join the records and will edit later. It is possible to have 16 records with the same key. Also could have just 1 record. I am placing the ID/Seq within an unused area of the record (bytes 80 for ID, and bytes 86 for Seq).
If there are no dupes, still want to keep the record.

Ok,
Looking at my post, I see that the spaces did not post. You can enlighten me on that also. Just added the code brackets. Hope that helps.

MODE STOP
SPLICE FROM(IN1) TO(DD01OUT) ON(001,8,CH) -
WITHANY KEEPNODUPS -
WITH(101,100) WITH(201,100) WITH(301,100) -
WITH(401,100) WITH(501,100) WITH(601,100) -
WITH(701,100) WITH(801,100) WITH(901,100) -
WITH(1001,100) WITH(1101,100) WITH(1201,100) -
WITH(1301,100) WITH(1401,100) WITH(1501,100) -
USING(DD01)



//DD01CNTL DD *
INREC IFOUTLEN=1600,
IFTHEN=(WHEN=GROUP,KEYBEGIN=(01,08),PUSH=(080:ID=5,086:SEQ=2)),
IFTHEN=(WHEN=(086,2,ZD,EQ,2),OVERLAY=(101:001,100)),
IFTHEN=(WHEN=(086,2,ZD,EQ,3),OVERLAY=(201:001,100)),
IFTHEN=(WHEN=(086,2,ZD,EQ,4),OVERLAY=(301:001,100)),
IFTHEN=(WHEN=(086,2,ZD,EQ,5),OVERLAY=(401:001,100)),
IFTHEN=(WHEN=(086,2,ZD,EQ,6),OVERLAY=(501:001,100)),
IFTHEN=(WHEN=(086,2,ZD,EQ,7),OVERLAY=(601:001,100)),
IFTHEN=(WHEN=(086,2,ZD,EQ,8),OVERLAY=(701:001,100)),
IFTHEN=(WHEN=(086,2,ZD,EQ,9),OVERLAY=(801:001,100)),
IFTHEN=(WHEN=(086,2,ZD,EQ,10),OVERLAY=(901:001,100)),
IFTHEN=(WHEN=(086,2,ZD,EQ,11),OVERLAY=(1001:001,100)),
IFTHEN=(WHEN=(086,2,ZD,EQ,12),OVERLAY=(1101:001,100)),
IFTHEN=(WHEN=(086,2,ZD,EQ,13),OVERLAY=(1201:001,100)),
IFTHEN=(WHEN=(086,2,ZD,EQ,14),OVERLAY=(1301:001,100)),
IFTHEN=(WHEN=(086,2,ZD,EQ,15),OVERLAY=(1401:001,100)),
IFTHEN=(WHEN=(086,2,ZD,EQ,16),OVERLAY=(1501:001,100))
OUTFIL FNAMES=DD01OUT,BUILD=(1,1600)

Code:

My Input (key in bytes 1 thru 8)
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
AAAAAAA                                          VIEW        DELET MOVE       
AAAAAAA                                          VIEW  INDEX DELET MOVE       
BBBBBBB                                                            MOVE       
BBBBBBB                                                      DELET             
BBBBBBB                                                INDEX                   
CCCCCCC                                          VIEW                         
CCCCCCC                                          VIEW  INDEX                   
******************************** Bottom of Data ********************************
 
 
 Output (AAAAAAA appeared to work, BBBBBBB did not)
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
AAAAAAA                                          VIEW        DELET MOVE        0
BBBBBBB                                                            MOVE        0
CCCCCCC                                          VIEW                          0
******************************** Bottom of Data ********************************
 
----+----9----+----0----+----1----+----2----+----3----+----4----+----5----+----6
********************************* Top of Data **********************************
0001 01             AAAAAAA                                          VIEW  INDEX
0002 01             ............................................................
0003 01             CCCCCCC                                          VIEW  INDEX
******************************** Bottom of Data ********************************
 
 
----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4
********************************* Top of Data **********************************
DELET MOVE        00001 02             ........................................
........................................BBBBBBB                               
                   00003 02             ........................................
******************************** Bottom of Data ********************************
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1205
Location: Bamberg, Germany

PostPosted: Mon Jul 17, 2023 11:15 pm
Reply with quote

Please, use code tags to properly format your Data/Code. The Button is below the Subject Line and above the input form. Thanks!

Also make sure to show input and desired result you are aiming for.
Back to top
View user's profile Send private message
Roger Booth

New User


Joined: 17 Jul 2023
Posts: 3
Location: United States

PostPosted: Mon Jul 17, 2023 11:52 pm
Reply with quote

The following is desired output. The 100 byte records are joined based on bytes 1 thru 8. With a possibility of 16 matching records for a 1600 byte output record.

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
AAAAAAA                                          VIEW        DELET MOVE
BBBBBBB                                                            MOVE
CCCCCCC                                          VIEW                 
**************************** Bottom of Data ****************************
 
 
--+----8----+----9----+----0----+----1----+----2----+----3----+----4----
***************************** Top of Data ******************************
                            AAAAAAA                                   
                            BBBBBBB                                   
                            CCCCCCC                                   
**************************** Bottom of Data ****************************
 
+----5----+----6----+----7----+----8----+----9----+----0----+----1----+-
***************************** Top of Data ******************************
     VIEW  INDEX DELET MOVE                                           
                 DELET                                  BBBBBBB       
     VIEW  INDEX                                                       
**************************** Bottom of Data ****************************
 
 
---2----+----3----+----4----+----5----+----6----+----7----+----8----+---
***************************** Top of Data ******************************
 
                                       INDEX                           
 
**************************** Bottom of Data ****************************
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1205
Location: Bamberg, Germany

PostPosted: Tue Jul 18, 2023 12:03 am
Reply with quote

Data from all unique keys concatenated "as is" then, right?
Back to top
View user's profile Send private message
Roger Booth

New User


Joined: 17 Jul 2023
Posts: 3
Location: United States

PostPosted: Tue Jul 18, 2023 12:18 am
Reply with quote

Yes. No change to the individual records. Just join them one after another.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1205
Location: Bamberg, Germany

PostPosted: Tue Jul 18, 2023 3:22 pm
Reply with quote

Sample:
Code:
//ICETOOL  EXEC PGM=ICETOOL                                           
//IN       DD *                                                       
AAAAAAA    A                                                         
AAAAAAA    B                                                         
AAAAAAA    C                                                         
AAAAAAA    D                                                         
AAAAAAA    E                                                         
AAAAAAA    F                                                         
CCCCCCC    XY                                                   
BAAAAAA    D                                                         
BAAAAAA    E                                                         
BAAAAAA    F                                                         
BAAAAAA    A                                                         
BAAAAAA    B                                                         
BAAAAAA    C                                                         
/*                                                                   
//OUT      DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//TOOLMSG  DD SYSOUT=*                                               
//TOOLIN   DD *                                                       
  SPLICE FROM(IN) TO(OUT) ON(1,7,CH) WITHANY KEEPNODUPS USING(SPLC) -
    WITH(12,2) WITH(14,2) WITH(16,2) WITH(18,2) WITH(20,2) WITH(22,2)
/*                                                                   
//SPLCCNTL DD *                                                       
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(30:SEQNUM,2,ZD,RESTART=(1,7))),   
    IFTHEN=(WHEN=(30,2,ZD,EQ,+2),BUILD=(1,7,14:12,2)),               
    IFTHEN=(WHEN=(30,2,ZD,EQ,+3),BUILD=(1,7,16:12,2)),               
    IFTHEN=(WHEN=(30,2,ZD,EQ,+4),BUILD=(1,7,18:12,2)),               
    IFTHEN=(WHEN=(30,2,ZD,EQ,+5),BUILD=(1,7,20:12,2)),               
    IFTHEN=(WHEN=(30,2,ZD,EQ,+6),BUILD=(1,7,22:12,2)),               
    IFTHEN=(WHEN=(30,2,ZD,EQ,+7),BUILD=(1,7,24:12,2)),               
    IFTHEN=(WHEN=ANY,BUILD=(1,29)),                                   
    IFTHEN=(WHEN=NONE,BUILD=(1,29))                                   
/*

Output:
Code:
****** ***************************
000001 AAAAAAA    A B C D E F     
000002 BAAAAAA    D E F A B C     
000003 CCCCCCC    XY       
****** ***************************
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
Search our Forums:

Back to Top