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



A

dcl-s CurrentUser VarChar(10) Inz(*User)

will give you current user.

To get to the program firing the trigger you need to use the stack
functions.

Basically you send a program message to a certain program in the stack and
the program before that program is the one that fired the trigger.

I have code if you are interested. Contact me directly.


On Wed, Jan 31, 2018 at 12:08 PM, Rob Berendt <rob@xxxxxxxxx> wrote:

Keep in mind the trigger could also be fired off from editing a DB2 file
directly in Excel, ODBC, etc.

Creating trigger programs
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/
dbp/rbaforzahftrb.htm
In there you can drill down to what's in the trigger buffer.
There is nothing specific in the trigger buffer pertaining to process or
current user profile (which may not be the job user).

Why do you need to know what process?
If the trigger is called by INV300 then display some 5250 window if
there is an error?
If the trigger is called by STRSQL then display a message or throw an
SQL exception?
If the trigger is called by Excel ...?
Or are you doing this because you want your own audit process and using
journaling or temporal tables is out of the question because they are too
thorough and easy to use?

Not a whole lot of information as to the process which called this trigger
in an RPG PSDS
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rzasd/psdsdt9.htm
However I do see the PSDS does support current user profile starting is
position 358.

How good are you at analyzing call stacks, etc, to find the process which
fired this trigger?

Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: JRusling@xxxxxxxxxxx
To: midrange-l <midrange-l@xxxxxxxxxxxx>
Date: 01/31/2018 02:50 PM
Subject: Information available when a db2 trigger fires off/calls
an rpg program.
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>



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.

John
<br />
The information in this email is confidential and may be legally
privileged.
It is intended solely for the addressee. Access to this email by anyone
else is
unauthorized. If you are not the intended recipient, any disclosure,
copying,
distribution or any action taken or omitted to be taken in reliance on it,
is
prohibited and may be unlawful.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


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.