Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
MERGE two files but keeping the duplicates

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: MERGE two files but keeping the duplicates
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 Moderator


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

PostPosted: Tue Nov 04, 2008 9:54 pm    Post subject:
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    Post subject:
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    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 Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us