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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Tue Apr 07, 2015 9:13 pm    Post subject: Compare VB files field by field-Delimited by PIPE/Tab
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: 268
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Tue Apr 07, 2015 9:30 pm    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Tue Apr 07, 2015 9:47 pm    Post subject:
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: 331
Location: USA

PostPosted: Tue Apr 07, 2015 10:50 pm    Post subject: Reply to: Compare VB files field by field-Delimited by PIPE/Tab
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Tue Apr 07, 2015 11:33 pm    Post subject:
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: 331
Location: USA

PostPosted: Wed Apr 08, 2015 12:21 am    Post subject: Reply to: Compare VB files field by field-Delimited by PIPE/Tab
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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Wed Apr 08, 2015 12:29 am    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

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

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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Wed Apr 08, 2015 7:31 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 24 Tue Dec 06, 2016 8:04 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm


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