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: 1335
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: 1335
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: 1335
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
jimsnow

New User


Joined: 20 Feb 2023
Posts: 9
Location: us

PostPosted: Tue Oct 22, 2024 6:26 pm
Reply with quote

Hello -

I have a situation where I need to combine multiple unique records into a single record.

Input (FB 80/data length = 12 bytes/trailing spaces):

100AXXXXXXXX
100BXXXXXXXX
100CXXXXXXXX
.
.
.
100ZXXXXXXXX

Desired Output (FB 240 assuming 20 input records) :

100AXXXXXXXX100BXXXXXXXX100CXXXXXXXX...100ZXXXXXXXX

The data will not have duplicates. The output dataset will not contain trailing spaces, just the 12 bytes of data per input record. Expected volume is 20 records daily, but can vary by a record or 2.

I have looked for similar SPLICE examples in the forum, but have not located a similar post (most contain keyed data). Any suggestions are greatly appreciated.
Back to top
View user's profile Send private message
jimsnow

New User


Joined: 20 Feb 2023
Posts: 9
Location: us

PostPosted: Tue Oct 22, 2024 7:20 pm
Reply with quote

apologies - please disregard this post, I meant to post it as new.

still learning...

jimsnow wrote:
Hello -

I have a situation where I need to combine multiple unique records into a single record.

Input (FB 80/data length = 12 bytes/trailing spaces):

100AXXXXXXXX
100BXXXXXXXX
100CXXXXXXXX
.
.
.
100ZXXXXXXXX

Desired Output (FB 240 assuming 20 input records) :

100AXXXXXXXX100BXXXXXXXX100CXXXXXXXX...100ZXXXXXXXX

The data will not have duplicates. The output dataset will not contain trailing spaces, just the 12 bytes of data per input record. Expected volume is 20 records daily, but can vary by a record or 2.

I have looked for similar SPLICE examples in the forum, but have not located a similar post (most contain keyed data). Any suggestions are greatly appreciated.
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 combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts SORT JCL to merge multiple tow into s... DFSORT/ICETOOL 6
No new posts To Omit records based n SORT condition DFSORT/ICETOOL 6
No new posts Using Multiple IFTHEN and WHEN condit... SYNCSORT 12
No new posts To fetch records that has Ttamp value... DFSORT/ICETOOL 5
Search our Forums:

Back to Top