× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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?


"Jon Paris" <jon.paris@xxxxxxxxxxxxxx> wrote in message
news:mailman.3126.1282065516.2619.rpg400-l@xxxxxxxxxxxxxxx
Well in your original code you were EVALing individual fields - I was
just pointing out that there was a simpler way.

If globals works for you then you have a scenario where qualified DS are
not needed anyway.

I don't see why you have to do it every time - that doesn't make sense.
You do it as and when you need to update/write to a specific file and you
do it just before the output.

You say that global also presents problems - what are they?

We could offer better suggestions if you told us the design issue you are
facing rather than showing us code. If we know what and why you are
trying to achieve we may be able to offer a more satisfactory
alternative.


Jon Paris

www.Partner400.com
www.SystemiDeveloper.com



On Aug 17, 2010, at 1:00 PM, rpg400-l-request@xxxxxxxxxxxx wrote:

Well, Jon, There lies the problem: To do what you suggested, that means
each time the program performs chain/update/write/read, I've to do
remember to do eval-corr to make sure all version of qualified DS
contains the same data. The best choice seems to be to not use
result-field DS (fall back to global). But this has its own problem
also.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.