|
ok. I guess my OP is not stating my problem too clear. Sorry about that.
2nd try:
Let's assume that I've green screen app that allows user to pull up
customer
record in serveral different ways, by customer #, by Creditcard #, by
SSN....
I order to lookup the customer record base on whichever lookup method user
used on the screen, I would need to have two or more customer master
logical
files (one for each lookup method) on F spec. After using the proper
logical file to lookup customer record, the program displays the customer
record to the user, user then updates the info on the screen and press
enter. The RPG program then validates it and update the Customer record.
If I don't use qualified result-field DS, then everything is business as
usual. Since fields in all those different logical files are global and
there is only one set them, It does not matter which logical file the
program uses to lookup the customer record. The same set of fields are
populated after a sucessful chain. Again, since there is only one set of
fields, I can freely use then without regard to which logical the program
has used to chain.
in this case, the RPG program would look like this:
if customer# <> 0;
chain (customer#) CUSTL1;
elseif creditcard# <> 0;
chain (creditcard) CUSTL2;
elseif ssn <> 0;
chain (ssn) CUSTL3;
. . .
endif;
ScreenField_CustName = CUSTNAM;
exfmt mainScreen;
CustNam = ScreenField_CustName;
chain (CUST#) CUSTL0 tmpCUST;
update CUSTL0;
How/what would be the best way to handle above if I prefer to always use
result-field DS when performing file IO opcode?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.