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


  • Subject: Trigger pgm: user & pgm id
  • From: John Carr <74711.77@xxxxxxxxxxxxxx>
  • Date: Wed, 5 Nov 1997 21:07:43 -0500


RE:     Trigger pgm: user & pgm id

Karen 
Short of using API's you could call a CLP which does a SNDPGMMSG 
and do a RCVMSG which will tell you the calling program name.

Something like this;

PGM    &CALLED &CALLER

DCL    &CALLED  *CHAR    10
DCL    &CALLER   *CHAR   10
DCL    &M1KEY    *CHAR    4
DCL    &M1MDATA  *CHAR   80

SNDPGMMSG    MSG('TEST')  TOPGMQ(*PRV  &CALLED)  MSGTYPE(*RQS) KEYVAR(&M1KEY)


RCVMSG     PGMQ(*PRV &PGM)  KEYVAR(&M1KEY) SENDER(&M1MDATA)

CHGVAR     &CALLER   %SST(&M1DATA   56 10)

ENDPGM

&CALLER is the caller of what ever is passed in the variable &CALLED.

Call CL this from your trigger program X times.   1st time pass it your 
trigger program name in &CALLED.   This will return the OS/400 program
(DB pgm) that called your trigger. 

Call this CL again passing it what was returned the 1st time in the 
&CALLED parm to start over.

This will return who called him.  Do this over and over till you
get a program that doesn't start with a Q.

This is a generic little utility.

The top should be *EXT. 

John Carr

I would like to identify the program and user that tripped the *UPDATE trigger 
when
they were updating a database file.  We are using V3R1, not under journaling,
commitment control, or ILE.  Just OPM Cobol at the moment.  What (CL) command 
can
I use in my (Cobol) trigger program to identify this?  (We want to place the 
before and
after images of the database change in a history file, with time, user and 
program that
made the change.)

TIA.
Karen Bellecci
kbellecci@osfa.state.la.us
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to "MIDRANGE-L@midrange.com".
| To unsubscribe from this list send email to MAJORDOMO@midrange.com
|    and specify 'unsubscribe MIDRANGE-L' in the body of your message.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
uucp
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to "MIDRANGE-L@midrange.com".
| To unsubscribe from this list send email to MAJORDOMO@midrange.com
|    and specify 'unsubscribe MIDRANGE-L' in the body of your message.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.