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
 

 

To copy duplicates from two files in to one file

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

New User


Joined: 10 Feb 2006
Posts: 7

PostPosted: Wed May 02, 2007 9:48 am    Post subject: To copy duplicates from two files in to one file
Reply with quote

is it possible to copy duplicates from two files in to one file ?
if please leeme know how can it be done ? ?
file 1 :

abc
ddd
fff

file 2

eee
ddd
ggg

file 3

ddd
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 May 02, 2007 8:33 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//CON DD DSN=... input file1
//    DD DSN=... input file2
//OUT DD DSN=...  output file
//TOOLIN   DD    *
SELECT FROM(CON) TO(OUT) ON(1,3,CH) FIRSTDUP
/*
Back to top
View user's profile Send private message
raam_kumar

New User


Joined: 25 Apr 2007
Posts: 44
Location: chennai, India

PostPosted: Thu May 03, 2007 11:04 am    Post subject:
Reply with quote

I think it would be better if we use
SELECT FROM(CON) TO(OUT) ON(1,3,CH) ALLDUPS

instead of

SELECT FROM(CON) TO(OUT) ON(1,3,CH) FIRSTDUP

Please correct me if i am wrong
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: Thu May 03, 2007 9:23 pm    Post subject:
Reply with quote

Raam,

You're wrong and you could have corrected yourself if you had just tested what you proposed.

Siva2 stated that the output should be:

ddd

With FIRSTDUP, the output is:

ddd

as requested.

With ALLDUPS, the output is:

ddd
ddd

which is NOT as requested.

In the future, I'd suggest you test your solution before posting, especially if you're going to "correct" the person who "invented" the tool (ICETOOL) being used.
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


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