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 2 files based on account number

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

Active User


Joined: 15 Dec 2005
Posts: 237

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

Anuj Dhawan

Senior Member


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

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: 8593
Location: Back in jolly old England

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: 7130
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: 237

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: 7130
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
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm

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