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



This is what we use. You can totally do this with API's, but I was lazy.


Code in the trigger:
*
* Ignore booking related changes to inventory.
*
C eval IgnDBchg = ChkInvStk('PR0305R')


ILE procedure:
* **********************************************************
* Check invocation stack for a program.
* **********************************************************
P ChkInvStk B Export
*
D ChkInvStk PI like(StdInd)
D PgmNam like(StdNam) value
*
D PgmFnd s like(StdInd) inz
* ---------------------------------------------------------
*
* If program ID is blank, just return.
*
C if PgmNam = *blanks
C return *off
C endif
*
* Call CL program to perform the check.
*
C CALL 'UT1130C'
C PARM PgmNam
C PARM PgmFnd
*
C return PgmFnd
*
P ChkInvStk E


CL program UT1130C:
PGM PARM(&CHKPGM &FNDPGM)

DCL VAR(&CHKPGM ) TYPE(*CHAR) LEN(010)
DCL VAR(&FNDPGM ) TYPE(*CHAR) LEN(001)

MONMSG MSGID(CPF0000 MCH0000) EXEC(GOTO STDERR1)
CHGVAR VAR(&FNDPGM) VALUE('1')

RCVMSG PGMQ(*SAME &CHKPGM) RMV(*NO)
MONMSG MSGID(CPF0000) +
EXEC(DO)
RCVMSG
CHGVAR VAR(&FNDPGM) VALUE('0')
ENDDO

RETURN


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Troy Foster
Sent: Friday, August 03, 2007 12:31 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Getting the name of a trigger-causing program

archive.midrange.com/rpg400-l/200508/msg00477.html

On 8/3/2007 2:17 PM, Luis Rodriguez wrote:

Hi List,

Is there any that I can obtain, in a RPG Trigger processing
program, the name of the program that caused the trigger to
occur in first place?

Thanks,

Luis Rodriguez


Luis Rodriguez

IBM Certified Systems Expert
eServer i5 iSeries Technical Solutions





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.