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



Pete,
Don't know all the specifics but will try.  The SNDPGMMSG command with *PRV
QDBPUT/QDBUDR(depends on whether Insert or notInsert as tested in the fndtrg
pgm) goes to the program that called it (just an IBM thing), the RCVMSG
(separate command) puts this information in the &SENDER variable.  Then the
CHGVAR VAR(&PGM) VALUE(%SST(&SENDER 56 10)) puts the program name that
called the trigger as the value in the &PGM variable.  When this CL pgm ends
it returns to the trigger pgm (and the parm contains the program name) you
can test whatever  (like IF TrgInvkPgm = 'AMBJXSFR') and go from there.
(TrgInvkPgm was one of the two parms 1.event 2.pgm when calling the findtrg
CL and now contains the value of &PGM variable)

I believe for this to work you would have to call it from the GL001C (the
actualy trigger pgm) before calling GL001R.

Just read your other question.  The only way I can think to know everything
that touches a file is to DSPPGMREF ALLUSR/*ALL  to an outfile and query
that outfile for your file.  If someone does an ad hoc UPDDTA, I don't know
how to capture that.  I am sure there are articles/forums on mcpressonline
that discuss how to do it, though.  If you are asking how to know which pgms
actually set off the trigger, you can create a file to hold records
containing the TrgInvkPgm value every time your trigger pgm kicks off.

There is an article on www.MCPRESSONLINE.COM entitled The Trigger is the
Safety Part 2  in the articles archive.  It shows how to do this in RPG
instead of CL.  There are many other articles/forumdiscussions on triggers
at that site, also.

Ann

-----Original Message-----
From: mapics-l-bounces@xxxxxxxxxxxx
 Behalf Of Pete
Sent: Friday, May 09, 2003 12:44 PM
To: MAPICS ERP System Discussion
Subject: Re: Trigger
Ann,
Thanks for the help. I guess I am not real familar with the sndpgmmsg
command.
>            SNDPGMMSG MSG(' ') TOPGMQ(*PRV (QDBPUT)) MSGTYPE(*INFO)
>            RCVMSG PGMQ(*PRV (QDBPUT)) MSGTYPE(*LAST) RMV(*YES) +
>                   SENDER(&SENDER)
I am not sure what it is looking for where you have QDBPUT... can you
explain please...
On file GELMAS my trigger pgm is GL001C & it runs GL001R.
thanks
Pete

----- Original Message -----
From: Ann Neal <aneal@xxxxxxxxxxxxxxxxxx>
To: MAPICS ERP System Discussion <mapics-l@xxxxxxxxxxxx>
Sent: Friday, May 09, 2003 12:03 PM
Subject: RE: Trigger
> Pete,>
> Call this pgm with two parms (&PGM is *BLANKS) from your trigger pgm...
> modify the pgm below to fit your needs.  This pgm populates the &PGM
> variable.

>> -----Original Message-----
> From: mapics-l-bounces@xxxxxxxxxxxx
 Behalf Of Pete
> Sent: Friday, May 09, 2003 9:38 AM
> To: MAPICS ERP System Discussion
> Subject: Trigger
> List,
>     I am putting a trigger on a file When the file is read. What I want to
> do is capture the original calling program, or procedure (Mapics pgm, cl,
> dfu, qry, user program). Not the Trigger pgm.   I have a program status
data
> structure in my trigger pgm, but that gives me the trigger pgm.. Is there
a way to do this.?
> Any thoughts?
> TIA
> Pete Olshavsky


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.