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

Compare VB files field by field-Delimited by PIPE/Tab


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

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Tue Apr 07, 2015 9:13 pm
Reply with quote

Here is the requirement,

1.Match both the file based on key (data in bettween 3rd tabs-acct #)
2. File1 is a driver file and matched/compared against file2
3.compare data between each tab of a record for every match
4.write output file (as shown ) with the mismatched fields
File1: VB-100
Code:
AA|11418|0028667327|22.11||
AA|111|0028661127|2.11||
AA|111|0048661127|2.15||

File2:VB-100
Code:
AA|11412|0028667327||1.8|
BA|111|0028661127|2.11||1.874
AA|111|0048661127|2.15||

Output:FB-100
Code:
0028667327|11418|22.11|
0028661127|AA|


I am going with a COBOL Program/Export these data into excel and then compare two excel field by field but any directions on SORT would be helpful and let me know if any information is expected.
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Tue Apr 07, 2015 9:30 pm
Reply with quote

Hi Rohit,

You could try to convert both the files into Fixed length format(for each field) with PARSE in INREC and then perform a join and then convert it into the format you need.

Check this post. It might be of some help.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Tue Apr 07, 2015 9:47 pm
Reply with quote

Thanks Mishtah, but how will it tackle with only unmached fields( from file1) in the output?
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Tue Apr 07, 2015 10:50 pm
Reply with quote

As far as I understand the requirement, using SPLICE in ICETOOL should be able to help you. Could you please elaborate if that is not the case?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Apr 07, 2015 11:33 pm
Reply with quote

Rohit Umarjikar wrote:
Thanks Mishtah, but how will it tackle with only unmached fields( from file1) in the output?


You'd have to code for the mismatches. Presumably you don't have many fields, else the output is going to be "confusing" :-)

INREC in the JNFnCNTL files with PARSE to get the key to a fixed location at the beginning of the records.

Then the match on the third field is easy. No JOIN statement. REFORMAT record to include all data from both files.

You have a choice of where to do the PARSE for the other fields, either in JNFnCNTLs, or from the REFORMAT record. The REFORMAT you can make fixed or variable.

If your input is VB 100, you output only needs to be FB 96. The last four must always be blank, as you only have 96 bytes of data. You'd need some SQZ to unfix the fields.

Before getting too far with it, check that the output should really be like that. You'll know a field is "different", but you won't know which field, or what it is different to.

Number of fields? Is data already in sequence on the match key? Number of records? Answers to the questions will point to the detail of how to go.

I'd avoid SPLICE :-)
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Wed Apr 08, 2015 12:21 am
Reply with quote

Ah.. I understand it now. It's the unmatched 'fields' that Rohit want.

I was thinking about another possibility that is:

1. Reformat the data to make fields columnwise (using PARSE)
2. Create a copybook for the reformatted record (not a necessity but it's better to have it)
3. Use File Manager/File Aid's compare utility in batch to show the fields with a difference using the copybook

This may not be the format you want but if it is for information only then it should do.
?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Wed Apr 08, 2015 12:29 am
Reply with quote

Thanks Bill.

Is it feasible after all these?

Quote:
Number of fields? Is data already in sequence on the match key? Number of records? Answers to the questions will point to the detail of how to go.


1.There are total 42 fields actually :-(, I just gave some samples to get an idea.
2.Yes, It is in sequence
3.close to 10k records are present.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Wed Apr 08, 2015 6:05 am
Reply with quote

Rahul, Your idea helps. Thanks.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Wed Apr 08, 2015 7:31 am
Reply with quote

Mistah, apparently I see I am doing what you suggested but still wondering how would I list on a field level?

thanks Bill and all. I will try to complete it further.
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 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 Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
Search our Forums:

Back to Top