SORT to compare 2 files and write to 3rd file



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

SORT to compare 2 files and write to 3rd file

Postby manjeera.bonakurthi » Fri Feb 19, 2010 4:18 pm

Hi...
I have 2 files..
File A:
LRECL - 3099
RECFM - VB

File B :
LRECL - 1117
RECFM - VB

I have to compare these two files with fields of position from 103-117 (ACC.NO) of file A with position 2-16 of file B .... and...
163-166 (DATE) of file A with 28-31 (DATE) of file B...

IF A MATCH OCCURES FOR BOTH FIELDS ...

Then I have to write fields of position 592-595 (TRANS-ID) of file A and 23-26(TRANS-ID) of file B...

File A
       
        ACC.NO              DATE                   TRANS-ID
------103--117------------163-166-----------------592-595---------
       1234               12/02/10                   1
       1234               10/04/10                   2     
       2345              03/03/10                   3
       3456               11/03/10                   4

File B
       ACC.NO               TRANS-ID                   DATE
------2-16----------------23-26----------------------28-31---------
      1234                    12                     04/05/10
      1234                    13                      10/04/10             
      2345                    14                      09/09/10
      3456                    15                      11/03/10


The o/p file shud b....

TRANS-ID (FILE A)                    TRANS-ID (FILE B)
       2                                         13
       4                                        15

The files does not have duplicates...
The fields (ACC.NO+DATE) acts as composite key in matching purpose...

HOW CAN I ACHIEVE THIS USING SORT UTILITY?
manjeera.bonakurthi
 
Posts: 13
Joined: Fri Feb 19, 2010 10:54 am
Has thanked: 0 time
Been thanked: 0 time

Re: SORT to compare 2 files and write to 3rd file

Postby Alissa Margulies » Fri Feb 19, 2010 10:40 pm

This appears to be a duplicate post, therefore, I am locking this one since the other has been answered.
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 3 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post