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



You also want to ignore the QSQ programs also, as these are programs that "run" the embedded SQL statement(s).

Duane Christen

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Mark S. Waterbury
Sent: Wednesday, October 01, 2008 11:44 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: Best way to determine which program is causing
execution oftrigger program.

Hi, Stephen:

Put your trigger program in debug, and set breakpoints, and
run a program interactively that updates the file, thus
invoking the trigger, and when it stops at a breakpoint in
the trigger program, issue F21 to get a command line, and
type DSPJOB and then select option "11. Call stack" to see
the call stack. This should give you a better idea of what's going on.

The IBM database I/O routines all begin with "QDB" (e.g.
QDBGET, QDBPUT,
etc.) -- it is responsible for calling the trigger program.
So, the one you want, your program that issued the I/O that
caused the trigger to get invoked, will always be one level
higher (or one level back) from the QDBxxx program in the
call stack. Does this "make sense"?

Hope that helps,

Mark S .Waterbury

> Brown, Stephen GRNRC wrote:
Alan,

Now compiled and I am debugging, noticed something else
that hopefully
you can help me with. I am debugging a batch job using
strsrvjob etc I
have added a record to the file that executes the trigger.
The first
program your piece of code finds when doing an insert is
QDBPUT which
is in QSYS. Now I'm not sure if this is result of service
job debug or
whether this relates to something background task. Now guess I can
always check the program library and if it matches the
library we keep
all our program objects then I can select this program as the
originating one. Just thought I'd mention this in case there was
something I was missing or can do to avoid the QDBPUT etc.


Thanks again for your help






-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan Shore
Sent: 01 October 2008 15:09
To: RPG programming on the AS400 / iSeries
Subject: RE: Best way to determine which program is causing
execution
oftrigger program.


Sorry Stephen, I knew there would be something I forgot
They are part
of the SDS We have a copybook for this
D sds
D psdsPgmName *proc
D psdsStatus *status
D psdsPstatus 5S 0
D psdsLineNbr 8A
D psdsRoutine *routine
D psdsParms *parms
D psdsException 7A
D psdsExcType 3A overlay(psdsException)
D psdsExcNbr 3A overlay(psdsException:4)
D psdsMsgWork 51 80A
D psdsPgmLib 81 90A
D psdsMsgData 91 170A
D psdsFile 175 184A
D psdsJob 244 253A
D psdsUser 254 263A
D psdsJobNbr 264 269S 0
D psdsProcProg 334 343A
D psdsProcMod 344 353A
D psdsLineNbr2 354 355I 0

If theres anything else you need



Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxxxxx
P:(631) 244-2000 ext. 5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill

rpg400-l-bounces@xxxxxxxxxxxx wrote on 10/01/2008 09:51:10 AM:


Alan,

What are the two fields psdsPgmName and psdsPgmLib ? And
what/where
are they defined


Thanks



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan Shore
Sent: 01 October 2008 13:35
To: RPG programming on the AS400 / iSeries
Subject: RE: Best way to determine which program is
causing execution
oftrigger program.


Stephen
here is what I have used to find the name of the calling program

D GetCaller PR Extpgm('QWVRCSTK')
D 2000
D 10I 0
D 8 CONST
D 56
D 8 CONST
D 15

D Var DS 2000
D BytAvl 10I 0
D BytRtn 10I 0
D Entries 10I 0
D Offset 10I 0
D EntryCount 10I 0
D VarLen S 10I 0 Inz(%size(Var))
D ApiErr S 15
D JobIdInf DS
D JIDQName 26 Inz('*')
D JIDIntID 16
D JIDRes3 2 Inz(*loval)
D JIDThreadInd 10I 0 Inz(1)
D JIDThread 8 Inz(*loval)

D Entry DS 256
D EntryLen 10I 0
D PgmNam 10 Overlay(Entry:25)
D PgmLib 10 Overlay(Entry:35)

c eval CallingPgmNam = *blanks
c eval CallingPgmLib = *blanks
C CallP
GetCaller(Var:VarLen:'CSTK0100':JobIdInf
C :'JIDF0100':ApiErr)
C Do EntryCount
C Eval Entry = %subst(Var:Offset + 1)
c if CallingPgmNam = *blanks and
c CallingPgmLib = *blanks
c if PgmNam = psdsPgmName and
c PgmLib = psdsPgmLib
C Else
c eval CallingPgmNam = Pgmnam
c eval CallingPgmLib = Pgmlib
C Endif
C Endif
C Eval Offset = Offset + EntryLen
C Enddo

I think I have everything
If not just drop me a line with whatever info you have



Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxxxxx
P:(631) 244-2000 ext. 5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill
rpg400-l-bounces@xxxxxxxxxxxx wrote on 10/01/2008 08:19:59 AM:


Sorry should have been more descriptive in my initial
email. I have
considered this but I do have other situations where I need to
differentiate between which interactive calling program
(And batch
for

that matter)is causing trigger and also I thought it
maybe handy for



other application.

I already have the call to QUSRJOBI (JOBI0400) in the Trigger
program but I really would like to determine the calling
program if
possible.

Thanks

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Hillier, Martin
Sent: 01 October 2008 12:46
To: RPG programming on the AS400 / iSeries
Subject: RE: Best way to determine which program is causing
execution oftrigger program.


Hi Stephen,

Your description makes it sound more like you want to use
job type
rather than calling program. Check out the RTVJOBA
command, and its
corresponding API if thats the case.

Cheers,
Martin

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Brown, Stephen
GRNRC
Sent: 01 October 2008 12:23
To: RPG400-L@xxxxxxxxxxxx
Subject: Best way to determine which program is causing execution
oftrigger program.

Folks,

Anyone know of the best way to determine which program is the
causing execution of a trigger program.

I would like to do different things when trigger is
executed as the
result of an interactive change to a file as opposed to
one caused
by a batch change.



Thanks.



Confidential, unpublished property of CIGNA Do not duplicate or
distribute. Use and distribution is limited solely to authorised
personnel.
(c) Copyright 2008 (CIGNA Corporation)



--------------------------------------------------------------------
--
--
------
CONFIDENTIALITY NOTICE: If you have received this email in error,

please

immediately notify the sender by e-mail at the address
shown. This
email transmission may contain confidential information. This
information is intended only for the use of the individual(s) or

entity

to whom it is intended even if addressed incorrectly.
Please delete

it

from your files if you are not the intended recipient. Thank you
for your compliance. Copyright 2008 CIGNA



=====================================================================
=
==

======
--
This is the RPG programming on the AS400 / iSeries (RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting,
please take
a moment to review the archives at
http://archive.midrange.com/rpg400-l.

--------------------------------------------------------

This message (including any attachments) is only for the
use of the
person(s) for whom it is intended. It may contain Mattel
confidential and/or trade secret information. If you are not the
intended recipient, you should not copy, distribute or use this
information for

any purpose, and you should delete this message and inform the
sender immediately.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting,
please take
a moment to review the archives at
http://archive.midrange.com/rpg400-l.







---------------------------------------------------------------------
-
--
------


CONFIDENTIALITY NOTICE: If you have received this email in error,
please immediately notify the sender by e-mail at the
address shown.



This email transmission may contain confidential
information. This
information is intended only for the use of the individual(s) or
entity to whom it is intended even if addressed
incorrectly. Please



delete it from your files if you are not the intended recipient.
Thank

you for your compliance. Copyright 2008 CIGNA



=====================================================================
=
==
======


--
This is the RPG programming on the AS400 / iSeries (RPG400-L)
mailing

list

To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting,
please take
a moment to review the archives at
http://archive.midrange.com/rpg400-l.


--
This is the RPG programming on the AS400 / iSeries
(RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting,
please take a
moment to review the archives at
http://archive.midrange.com/rpg400-l.







----------------------------------------------------------------------
--
------


CONFIDENTIALITY NOTICE: If you have received this email in error,
please immediately notify the sender by e-mail at the
address shown.
This email transmission may contain confidential
information. This
information is intended only for the use of the individual(s) or
entity to whom it is intended even if addressed
incorrectly. Please
delete it from your files if you are not the intended recipient.
Thank



you for your compliance. Copyright 2008 CIGNA



======================================================================
==
======


--
This is the RPG programming on the AS400 / iSeries
(RPG400-L) mailing

list

To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting,
please take a
moment to review the archives at
http://archive.midrange.com/rpg400-l.


--
This is the RPG programming on the AS400 / iSeries (RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit
http://www.messagelabs.com/email
______________________________________________________________________


NOTICE: This electronic mail transmission may contain confidential information and is intended only for the person(s) named. Any use, copying, or disclosure by any other person is strictly prohibited. If you have received this transmission in error, please notify the sender via e-mail.

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.