Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Merge 2 files based on account number

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

Active User


Joined: 15 Dec 2005
Posts: 56

PostPosted: Thu Mar 27, 2008 12:28 pm    Post subject: Merge 2 files based on account number
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
References
PostPosted: Thu Mar 27, 2008 12:28 pm    Post subject: Re: Merge 2 files based on account number Reply with quote

Anuj D.

Senior Member


Joined: 22 Apr 2006
Posts: 1123
Location: Phoenix,AZ

PostPosted: Thu Mar 27, 2008 1:41 pm    Post subject:
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: 2154
Location: Brussels once more ...

PostPosted: Thu Mar 27, 2008 5:06 pm    Post subject:
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 Moderator


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

PostPosted: Thu Mar 27, 2008 9:20 pm    Post subject:
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: 56

PostPosted: Mon Mar 31, 2008 2:30 pm    Post subject:
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 Moderator


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

PostPosted: Mon Mar 31, 2008 9:23 pm    Post subject:
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1