×
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 08/03/2018 10:27:34
AM:
"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 08/02/2018 03:50:26
PM:
Thank you for your reply. Do you think this will work if I call
your procedure from my trigger program?
Yes, I call it from my trigger program for this very purpose.
Forgot to mention, though, that you have to bypass the SQL entries
in the call stack to get to the program that actually performed the
original I/O operation. Here is the code I use to do that.
RefPgm = PROC_PGM; // starting with the current program
DoU QWVPGMN = *blanks // find previous program in call stack
or RefPgm = 'QSQIMAIN' // which may be STRSQL
or RefPgm <> PROC_PGM // but not this program
and %subst(RefPgm:1:1) <> 'Q'; // or any other IBM program
QWVCSTKE = GenUtl_FindCallStackEntry('*PRV': RefPgm);
if QWVPGMN > *blanks; // if a program name is present
RefPgm = QWVPGMN; // save returned call stack program
endif;
enddo;
select;
when (%subst(RefPgm:1:3) = 'DBU');// if DBU utility found
RefPgm = 'DBU'; // set generic program id
when (RefPgm = 'QSQIMAIN'); // if STRSQL driver found
RefPgm = 'STRSQL'; // set command name, instead
other; // otherwise
if (QWVMN > *blanks); // if a module name is present
return QWVMN; // return that
endif;
endsl;
return RefPgm; // return name of originating program
Sincerely,
Dave Clark
As an Amazon Associate we earn from qualifying purchases.