× 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.



Eftimios Pantzopoulos wrote:

I found a tip from Bob Cozzi which detailed how to automatically map a DB record to a DS by using a prefix in the file declaration that was formatted to the qualified DS. This works and can be proven that only one move is required for the read by stepping through in DEBUG when *NODEBUGIO is NOT used.

The code looks like:

fafile uf e disk prefix('C.') usropn
:
d c ds likerec(rafile)
:
Read afile c;

The PREFIX keyword is unnecessary for what you want.

PREFIX is only necessary for the cases where you do not code the result DS on the I/O opcode.

The only thing the PREFIX keyword does is to cause the compiler-generated I specs to list fields C.NAME, C.ADDR instead of NAME and ADDR. Then during an input operation that doesn't have a result DS, the I specs would be run in the usual way, moving the fields from the input buffer into the RPG I spec fields, C.NAME and C.ADDR, one by one. For an input operation with a result DS, the I specs are skipped completely, as you've seen with your OPTION(*NODEBUGIO) test.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.