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
Software/Hardware used:
ASKED:
April 15, 2010 7:29 AM
UPDATED:
April 19, 2010 6:12 PM
Try someting like this SQL
good luck
DanF
If the two logicals are based on the same physical file this can not happen.
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
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.
…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
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.