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

Compare 2 files of differnt LRECL and diffrnt no. of records


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

New User


Joined: 17 Nov 2010
Posts: 14
Location: India

PostPosted: Wed Jan 12, 2011 6:08 pm
Reply with quote

Hi,

I have 2 input files, File A and File B.
File A has 20 records and LRECL=25
File B has 10000 records and LRECL=100.

Both files should be compared. File A has 8 fields in the order
A B C D E F G H

File B has 20 Fields in the order
K L M A J T I B V U S C P G Q H I Y D N F X W.

I want to compare File A's A B C D E F G H with File B's A B C D E F G H.
And in the output file i need A B C D E F G H X W ,that is the last two fields of File B included with all the fields of File A.


For example:


Code:


File A

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
NAME      PLACE     AGE  DOJ            EXP  GENDER
MARY      USA       22   10/11/2010     3       F
SAM       UK        34   07/08/2000     9       M


File B

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
NAME      PLACE     EXP  DOB            DEPT      STATUS
MARY      USA       3    11/11/1985     COMM      MARRIED
JANE      IND       1    21/05/1989     SCI       SINGLE
SAM       UK        9    17/09/1976     IT        MARRIED
 

Output File

 ----+----1----+----2----+----3----+----4----+----5----+----6----+----7-
 NAME      PLACE     AGE  DOJ            EXP  GENDER    STATUS
 MARY      USA       22   10/11/2010     3       F      MARRIED
 SAM       UK        34   07/08/2000     9       M      MARRIED



All the fields of File A is Present in File B but it is scattered.
And in output file i only need File A fields which match with File B And that with ONLY the fields in File A and The last 2 fields of file B of the corressponding records.

There can be duplicates in File B.
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 Jan 13, 2011 12:43 am
Reply with quote

I can't tell from your description and example which fields are where in the two files. You don't even list field E for file B.

With this level of information, about all I can tell you is that you can probably do what you want with DFSORT's JOINKEYS function. For complete information on JOINKEYS, see:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000174

For more examples, see the "Create files with matching and non-matching records" Smart DFSORT Trick at:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000094
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(F1 & F2) and writ... JCL & VSAM 5
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
No new posts VB to FB - Finding LRECL SYNCSORT 4
Search our Forums:

Back to Top