"MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx> wrote on 01/31/2018
02:49:49 PM:
When a process/program updates a file and causes the trigger to fire
which
then calls an rpg program --
1. Is the process/program that updated the file available to the rpg
program? (ie DBU, STRSQL, RUNSQLSTM or another program)
2. Is the user id which the process/program is running under available
to
the rpg program?
(I am assuming yes via the pgm status data structure)
Thanks for any help, tips or direction.
We have a single trigger program that is fired for all triggers.
It writes the trigger buffer to an associated data queue (~600 different
queues) and a long-running job (~600 different jobs) reads its data queue
in order to process the triggered data. I tell you that, because I
modified the header of the triggered buffer to include information that
would not be available to the long-running program once the trigger buffer
has gone through the data queueing process. I added 2 10-character fields
and overwrote a 3rd 10-character field (member name) to provide the
following information in the trigger header: This increased the trigger
header from 80 bytes to 100 bytes.
Original Job name
Original Program name
Original User name
The job name and user name easily come from the PSDS. I wrote a
service routine the provides call stack functions to the caller. It will
find a specific call stack entry or it will find the previous (caller)
call stack entry for a specified program. It returns the located call
stack entry including the long procedure name for the associated entry. It
call also optionally return the associated job information in the desired
format. .It uses the QWVRCSTK API for this functionality.
*========================================================================*
* Find the specified program's call stack entry or find the call stack *
* entry previous to it -- which is the caller of the specified program. *
* *FND option is the default for finding the specified program *
* *PRV option finds the previous caller of the specified program *
*========================================================================*
D GenUtl_FindCallStackEntry...
D PR LikeDS(GenUtl_CStkE)
D CStkFindOpt 4a Const
D CStkPgmName 10a Const
D CStkJInfo LikeDS(QWCF0100)
D Options(*Nopass: *Varsize)
D CStkJFmt 8a Const Options(*nopass)
Sincerely,
Dave Clark
As an Amazon Associate we earn from qualifying purchases.