comparing two logical files with the same fields to find the difference in the field which hold amount

15 pts.
Tags:
compare
difference
Logical Files
same fields
i have two logical files which have the same fields.The contents of the fields are the same except the filed which contains amount.How do i get the difference of the amount in the two files

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 6  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • DanTheDane
    Try someting like this SQL
    SELECT * FROM mylib/logigicalA a, mylib/logicalB b 
    WHERE a.keyfld = b.keyfld and (a.myfield - b.myfield) <> 0
    good luck DanF
    2,555 pointsBadges:
    report
  • WoodEngineer
    If the two logicals are based on the same physical file this can not happen.
    6,355 pointsBadges:
    report
  • TomLiotta
    If the two logicals are based on the same physical file this can not happen. With the information given, sure it can. All it needs is duplicate "keys". Of course, such results wouldn't be directly useful. Tom
    125,585 pointsBadges:
    report
  • WoodEngineer
    Good point, Tom. What I was trying to say but did not say so well is that a record retrieved via a logical file will always have the same values as the based-on record in the physical file.
    6,355 pointsBadges:
    report
  • TomLiotta
    ...always have the same values as the based-on record in the physical file. Okay, the PF has F1, F2, F3 and F4. The LFs have those plus F5. F5 is derived from F1+F2 in LFA, but F3+F4 in LFB. The problem is to track which derived values are different. However, I'd think the the LFs in the case of the question may be over different PFs. For example, one might be a current PF while the other is historical. The problem is to find where CurrentAmount differs from HistoricalAmount (except "Amount" is the field name in both cases.) The SQL suggestion might be sufficient. But maybe the OP doesn't have SQL easily available. (RPG might not even be available.) The question might need some additional explanation if there are restrictions we need to know. Tom
    125,585 pointsBadges:
    report
  • WoodEngineer
    Tom . . . I think we may be drifting off topic a bit here. I'm trying to re-assure Zabg that FieldX in LibA/FileB will have the same value in the physical and any logical build over that same file and field.
    6,355 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following