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

MERGE two files but keeping the duplicates


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

New User


Joined: 08 Aug 2008
Posts: 19
Location: Chennai

PostPosted: Tue Nov 04, 2008 4:03 pm
Reply with quote

Hi,

I have the following input files.

Input file 1:
-------------

AAAAA 001
BBBBB 002
CCCCC 003
CCCCC 003
CCCCC 003
CCCCC 003
DDDDD 004
EEEEEE 005
EEEEEE 005
EEEEEE 005
FFFFFF 006


Input File 2:
-------------
003 XXXXX
005 YYYYYY

I want the following output file.

Output File:
-------------
AAAAA 001
BBBBB 002
CCCCC 003 XXXXX
CCCCC 003 XXXXX
CCCCC 003 XXXXX
CCCCC 003 XXXXX
DDDDD 004
EEEEEE 005 YYYYYY
EEEEEE 005 YYYYYY
EEEEEE 005 YYYYYY
FFFFFF 006

I tried to achieve this with ICETOOL-SPLICE KEEPNODUPS option, I am not getting the required result. Can you suggest a solution for this.

Regards,
Jai
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: Tue Nov 04, 2008 9:54 pm
Reply with quote

Jai,

You can use a DFSORT/ICETOOL job like the following to do what you asked for. I assumed your input files have RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes. (Note that I am copying file2 before file1.

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD *
AAAAA  001
BBBBB  002
CCCCC  003
CCCCC  003
CCCCC  003
CCCCC  003
DDDDD  004
EEEEEE 005
EEEEEE 005
EEEEEE 005
FFFFFF 006
/*
//IN2 DD *
003 XXXXX
005 YYYYYY
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1)
SPLICE FROM(T1) TO(OUT) ON(8,3,CH) KEEPNODUPS -
  WITHALL WITH(1,6)
/*
//CTL1CNTL DD *
  INREC BUILD=(8:1,10,80:X)
/*
Back to top
View user's profile Send private message
vjai6977

New User


Joined: 08 Aug 2008
Posts: 19
Location: Chennai

PostPosted: Wed Nov 05, 2008 10:32 am
Reply with quote

Hi Frank,

This is a good learning about 'WITHALL WITH' parameter how to make use of it with SPLICE. This workd out for me. Thanks for your solution.


Regards,
Jai
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top