View previous topic :: View next topic
|
Author |
Message |
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
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 |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Thanks Mishtah, but how will it tackle with only unmached fields( from file1) in the output? |
|
Back to top |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Rahul, Your idea helps. Thanks. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
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 |
|
|
|