Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Comparison of 2 files - Need help

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Comparison of 2 files - Need help
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: 2150
Location: At my coffee table

PostPosted: Fri Apr 23, 2010 3:24 pm    Post subject: Re: Comparison of 2 files - Need help
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

Site Director


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

PostPosted: Fri Apr 23, 2010 7:40 pm    Post subject:
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    Post subject: Comarision of 2 files - Need Help
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts CICS NEW SIT PARAMETERS CICS BEHAVIOR... Kyle Carroll CICS 0 Fri Nov 04, 2016 11:55 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts Adding records from two files into on... shiitiizz SYNCSORT 4 Mon Sep 19, 2016 8:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us