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



"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 02/22/2018 03:32:10
PM:
On 22 February 2018 at 20:24, <dlclark@xxxxxxxxxxxxxxxx> wrote:

"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 02/22/2018
02:30:39
PM:
A given trigger program can always determine the Application Server
program
relevant to the file it's on and therefore one way to determine if
it is
case 2 would be to check if that program was in the call stack, by
using
an
API ( quite expensive I think? )


Our trigger program calls the system API (QWVRCSTK) to examine
the
call stack every time it is invoked -- in fact, potentially more than
once
per invocation (if SQL was used for the I/O). We wanted to determine
the
program that caused the I/O and pass that in a modified trigger buffer
header when writing the buffer to a data queue. This doesn't seem to
be
hurting our performance, but perhaps it is because we are using the
data
queue method so that the trigger program can return control as fast as
possible.

thanks for your reply.
I've used that API a few times, it might be my fallback position if I
can't
think of anything simpler.
I can't exactly recall why I think it's expensive to call, I guess I
could
always benchmark it and find out.

That said, I've been slightly guilty lately of making work for myself by
trying to be super efficient, only to find that the IBMi performs so
surprisingly well that I was making my life awkward for no real
reason...


I will say that (now that I think about it) I could have written
this to accomplish the same purpose without having to call the system API
more than once per trigger program invocation. The only reason mine is
the way it is is because I used a generic service procedure for returning
the information I needed.

Thus, if there are other call stack entries between the current
entry and the entry that actually represents the program that caused the
I/O (as in the case of the SQL Router routine, then my current setup ends
up calling the generic service procedure more than once -- to skip over
IBM routines.

So, I am not suggesting at all that you would have to call the
system API more than once. The system API can return the entire call
stack in a single call so it would be trivial to be able to search the
receiver variable for whatever entry you wanted without having to call the
system API again.


Sincerely,

Dave Clark

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.