× 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: RE:Who called me in Trigger
  • From: John Carr <74711.77@xxxxxxxxxxxxxx>
  • Date: Mon, 19 Oct 1998 19:25:20 -0400

Message text written by INTERNET:MIDRANGE-L@midrange.com
>
I know that this was answered at least once before, but if someone has it
if
you could re-post it I would appreciate it.

What I need is the caller (or the program that created the event) that
caused the trigger to be called.  Also, if you have any idea or history of
the performance of doing this.  Usually, getting the invocation stack is a
pretty expensive operation.  I would hate to do it on every operation,
but...  Thanks
John Bussert
Swift Technologies, Inc.
jbussert@stecnet.com
<

John


In your *INZSR subroutine repeatedly call a CLP to retrieve the program
name of the caller.  You can "walk up the Stack" past the programs(OS/400's
that begin with "Q")  to the program you're looking for. 

Just call the below program repeatedly(in a loop in your *INZSR),  First
time 
pass your trigger program name as the &CALLED, and who ever called your 
trigger will be returned in the &CALLER variable.  This will be a "Q" 
OS/400 program.  Call the CLP again this time pass what was returned the
first time to find out who called him, and so on.  up the stack till *EXT.

Stop when the program name(&CALLER) doesn't begin with a "Q". 
That's the program you want.

PGM    &CALLER &CALLED

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

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

RCVMSG   PGMQ(*PRV &CALLED)  MSGKEY(&M1KEY)  SENDER(&M1MDTA)

CHGVAR   &CALLER    %SST(&M1MDTA  56 10)

ENDPGM


John Carr
EdgeTech -  Have Classes, Will Travel
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| 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.