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

Merge 2 files based on account number


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

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Thu Mar 27, 2008 12:28 pm
Reply with quote

Dear all,

I want to merge 2 file for ex fil1,fil2 which is having following input

fil1
98765432
34567891
11111111
22222222

fil2
11111111
22222222

and the output should be
outfil
11111111
22222222

Regards,
Murali.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Mar 27, 2008 1:41 pm
Reply with quote

Hi,

I didn't understand why did you use the term "Merge", ouput shown is actually the common records between two files. Before someone go ahead with further suggestions, please clarify what exaclty you are looking for.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Mar 27, 2008 5:06 pm
Reply with quote

And supply record formats, record lengths, and key positions.
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: Thu Mar 27, 2008 9:20 pm
Reply with quote

Can input file1 have duplicates within it?

Can input file2 have duplicates within it?

If either file can have duplicates within it, show that in your example of input records and expected output records.
Back to top
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Mon Mar 31, 2008 2:30 pm
Reply with quote

Hi Frank,

Both input & output doesn'y have duplicates.

Regards,
Murali.
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: Mon Mar 31, 2008 9:23 pm
Reply with quote

Murali,

You haven't given a lot of information. Assuming you want the records from file1 that have a match in file2, you can use a DFSORT/ICETOOL job like this:

Code:

//S1    EXEC  PGM=ICETOOL                         
//TOOLMSG DD SYSOUT=*                             
//DFSMSG  DD SYSOUT=*                             
//CON DD *     input file1                                       
98765432                                           
34567891 
11111111                                           
22222222
//   DD *      input file2                                           
11111111                                           
22222222                                           
//OUT DD SYSOUT=*                               
//TOOLIN DD *                                     
SELECT FROM(CON) TO(OUT) ON(1,8,CH) FIRSTDUP       
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
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 Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top