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 Comparing two sequential files Mohan Kothakota COBOL Programming 14 Mon Apr 16, 2018 6:35 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am
No new posts Can we merge these two sort cards int... abdulrafi JCL & VSAM 2 Thu Mar 08, 2018 4:03 pm
No new posts How to build one file from two input ... daniele DFSORT/ICETOOL 5 Tue Feb 27, 2018 6:45 pm

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