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

Comparison of 2 files - Need help


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Cprasad

New User


Joined: 22 Apr 2010
Posts: 2
Location: India

PostPosted: Fri Apr 23, 2010 3:10 pm
Reply with quote

I have 2 files the 1st file length is 150 & 2nd one is 80.

Ex of File 1 :-
Code:
                    Chandu A 123456789 134578978 testing cmpny xxxxxx
                    SAM     A 888888888  134578978 testing cmpny xxxxxx
                    RAM     L 123456789  134578978 testing cmpny xxxxxx
                    Pooh    L 878787878  134578978 testing cmpny xxxxxx

Ex of File 2 :-
Code:
                  L  123456789  134578978
                  A  888888888  134578978
                  A  123456789  134578978
                  L  878787878  134578978

The Requirement is combination (A 123456789 134578978) of File1 should be compared with combination (A 3456789 134578978) of File2 if matched it shud be written to 3rd file and if only two values (combination (123456789 134578978) are matched and there is discripenct in the 3rd value ( A or L) we need to replace the same value of the first file with value of the 2nd file and wriiten to the 3rd file.

In breif,

Ex of File 1 :-
Code:
                   Chandu A 123456789 134578978 testing cmpny xxxxxx

Ex of File 2 :-
Code:
                  L  123456789  134578978


Out put shd look like
Code:
                   Chandu  L 123456789 134578978 testing cmpny xxxxxx
                                                   (we can see tht A is changed to L)
                   SAM     A 888888888  134578978 testing cmpny xxxxxx
                   RAM     L 123456789  134578978 testing cmpny xxxxxx
                   Pooh    L 878787878  134578978 testing cmpny xxxxxx
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri Apr 23, 2010 3:24 pm
Reply with quote

Cprasad wrote:
discripenct
Huh?
Between the shorthand and the mis-spellings, your post is somewhat confusing, care to try again?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Apr 23, 2010 7:40 pm
Reply with quote

Hello and welcome to the forum,


Might "discripenct" be discrepancy or simply "difference"?

Suggest you use the spellcheck (just below the reply text box) to make sure that the typos are minimized.
Back to top
View user's profile Send private message
Cprasad

New User


Joined: 22 Apr 2010
Posts: 2
Location: India

PostPosted: Fri Apr 23, 2010 9:48 pm
Reply with quote

Sorry for the Confusion.


File1:- F1

A dis 23456 7890 xxxx testing
A ram 5678 9870 yyyy coding
B sam 1234 3456 zzzz analysis
B cam 9998 8989 dfdf xyzxyz

File2:- F2
A 23456 7890
X 5678 9870
B 1234 3456
Y 9998 8989

File3:- output

A dis 23456 7890 xxxx testing
X ram 5678 9870 yyyy coding ------> A is replaced with X
B sam 1234 3456 zzzz analysis
Y cam 9998 8989 dfdf xyzxyz ------> B is replaced with Y


Requirement is


We need to compare F1 - 1,3,4 columns with F2- 1,2,3 coulmns, if matched we need we need to write that record as
it is to the output file. Suppose if the F1 1st column doesn't match with F2 1st column & other 2 columns of
two files are matched, then F1 1st cloumn value needs to be replaced with F2 1st column & written to the o/p file.
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 -> JCL & VSAM

 


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 Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top