Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need help on Splice

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
rguhanath

New User


Joined: 16 Oct 2006
Posts: 80
Location: chennai

PostPosted: Mon Sep 06, 2010 7:59 pm    Post subject: Need help on Splice
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: 578
Location: USA

PostPosted: Tue Sep 07, 2010 4:25 am    Post subject:
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: 80
Location: chennai

PostPosted: Tue Sep 07, 2010 9:22 am    Post subject:
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 Moderator


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

PostPosted: Wed Sep 08, 2010 12:58 am    Post subject:
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

http://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: 578
Location: USA

PostPosted: Wed Sep 08, 2010 7:37 am    Post subject:
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: 80
Location: chennai

PostPosted: Wed Sep 08, 2010 6:55 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Matching records using splice for COM... hiravibk DFSORT/ICETOOL 4 Sun Sep 27, 2015 12:05 pm
No new posts JOINKEYS or SPLICE? while retaining h... hsinaz50 DFSORT/ICETOOL 4 Thu Apr 17, 2014 12:13 am
No new posts Match 2 files using SPLICE sudib19 DFSORT/ICETOOL 6 Wed Dec 04, 2013 3:06 am
No new posts Syncsort - SPLICE only certain info. ramsri SYNCSORT 11 Wed Jul 24, 2013 4:48 pm
No new posts compare 2 file based on key+retain du... Hariharan BK DFSORT/ICETOOL 6 Thu May 02, 2013 12:04 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us