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

Need help on Splice


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

New User


Joined: 16 Oct 2006
Posts: 81
Location: chennai

PostPosted: Mon Sep 06, 2010 7:59 pm
Reply with quote

I have two input files F1 (LRECL = 100) and F2 (LRECL = 80) and have one output file OF1 (LRECL = 100). All three are FB.


Input file 1 : F1

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
ABC ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------
ABC ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------
ABC ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------
ABC ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------
DEF ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------
DEF ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------
GHI ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------
JKL ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------
JKL ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------
MNO ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------
MNO ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------


Input file 2 : F2
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
ABC  123 ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------
DEF  456 ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------
RST  631 ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------
JKL  654 ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------
XYZ  854 ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------


Output file : OF1

Code:

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

ABC ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------ 123
ABC ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------ 123
ABC ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------ 123
ABC ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------ 123
DEF ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------ 456
DEF ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------ 456
GHI ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------
JKL ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------ 654
JKL ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------ 654
MNO ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------
MNO ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------



Output file OF1 should include the corresponding numbers from F2 file after 55th location of F1. In F1 file, we have SPACES after 55th location.

Regards,
Nath.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Tue Sep 07, 2010 4:25 am
Reply with quote

rguhanath,
What's the matching key on both the files? First 3 bytes? Is it possible to have duplicates in File1 or File2 for the key?

Thanks,
Back to top
View user's profile Send private message
rguhanath

New User


Joined: 16 Oct 2006
Posts: 81
Location: chennai

PostPosted: Tue Sep 07, 2010 9:22 am
Reply with quote

Hi sqlcode1,

Yes, First 3 bytes are the matching key for F1 and F2. In this F1 having duplicates and F2 having the unique values for the first 3 bytes.

Thanks,
Nath.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Sep 08, 2010 12:58 am
Reply with quote

Are you trying to add the data in positions 6-8 of F2 to the data in positions 1-55 of F1 for the matching keys? You can do this with DFSORT's JOINKEYS function. See

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000174

for complete details on JOINKEYS.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Wed Sep 08, 2010 7:37 am
Reply with quote

rguhanath,
Looking back at your previous posts, I am assuming you don't have new PTF for joinkeys installed.

See if below jcl works for you...

Code:

//STEP01   EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DISP=SHR,DSN=YOUR FB80 FILE                               
//SORTOUT  DD DSN=&&T1,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)             
//SYSIN    DD *                                                         
  OPTION COPY                                                           
  INREC OVERLAY=(56:6,3,100:X)                                         
  OUTFIL REMOVECC,HEADER1=(3C'$'),                                     
                           TRAILER1=(3C'$')                             
//*                                                                     
//STEP02   EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=&&T1,DISP=SHR,VOL=REF=*.STEP01.SORTOUT             
//         DD DISP=SHR,DSN=YOUR FB100 FILE                             
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'$$$'),                   
                PUSH=(101:ID=1))                                       
  SORT FIELDS=(1,3,CH,A),EQUALS                                         
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(102:SEQNUM,8,ZD,RESTART=(1,3))),   
         IFTHEN=(WHEN=GROUP,BEGIN=(102,8,ZD,EQ,1),PUSH=(111:56,3))     
  OUTFIL INCLUDE=(101,1,ZD,EQ,2,AND,1,3,CH,NE,C'$$$'),                 
         BUILD=(1,55,111,3,59,42)                                       
//*                                                                     


OUTPUT
Code:

ABC ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------123             
ABC ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------123             
ABC ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------123             
ABC ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------123             
DEF ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------456             
DEF ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------456             
GHI ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------               
JKL ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------654             
JKL ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------654             
MNO ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------               
MNO ------SOME DATA WHICH IS UNIQUE OR NON-UNIQUE------               


Thanks,
Back to top
View user's profile Send private message
rguhanath

New User


Joined: 16 Oct 2006
Posts: 81
Location: chennai

PostPosted: Wed Sep 08, 2010 6:55 pm
Reply with quote

Hi sqlcode,

Many Thanks to you!!!... its working fine... Thanks for remembering my previous posts.


Regards,
Nath.
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 Join multiple records using splice DFSORT/ICETOOL 5
This topic is locked: you cannot edit posts or make replies. Splice JCL into one record for DD sta... SYNCSORT 2
This topic is locked: you cannot edit posts or make replies. Splice multiple records into single r... DFSORT/ICETOOL 9
No new posts Splice more than 50 occurances DFSORT/ICETOOL 1
No new posts Matching records using splice for COM... DFSORT/ICETOOL 4
Search our Forums:

Back to Top