Because an API call cannot take advantage of RPG's automatic data marshalling features. I often think that this was a major factor in the slow adoption by RPGers in general of web programming. Having to call an API for each and every field that is to be sent to the browser is a very different thing from simply doing (say) EXFMT.

You and I embraced the API approach - to many others it just looked like it was going to be worse than coding assembler or COBOL. Way too much typing.

Your example is frankly a little silly. The handler has to be named on the File definition so the purpose and limitations are somewhat obvious. If the handler is called ReadIFS then the programmer is hardly likely to expect it to eat with CHAIN. Just as they would not expect to use CHAIN with the target file that resulted from CPYTOIMPF that the handler is avoiding the necessity for.

The major reason for defending against unsupported op-codes is that OA does not provide a means by which the handler can identify to the compiler which operations are supported. As a result a maintenance programmer seeing that a file is keyed might be tempted to try to use SETLL if they are not thinking about which handler they are using. The compiler cannot defend against that so the handler must. Or the handler be modified to deal with such requirements if thy make sense in terms of the underlying technology.

Jon Paris

On Jan 16, 2019, at 11:47 AM, D*B <dieter.bender@xxxxxxxxxxxx> wrote:

We're just going to have to agree to disagree Dieter.

Suppose I want to use a web service and use an OA handler to enable CHAIN etc. to retrieve data via conventional RPG opcodes. I don't need to write a handler to deal with everything ... just the operations I am going to use. As long as I protect the user by having the handler error out any attempts at usage that is not supported by the handler then I don't see the problem.

You appear to be looking at OA simply from the perspective of enabling database modernization. I also look at it from that perspective but in addition as a vehicle for enabling the use of conventional RPG operations by folks who don't know (or indeed need to know) all the nuances of using web services or whatever.

I agree to disagree!

I would recommend to provide simply a callable proceure. Why should someone use chain and get's a Not_Implemented error, if (s)he tries a setll and read?

This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support by shopping at with our affiliate link:

This thread ...


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

This mailing list archive is Copyright 1997-2020 by 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].