×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




John,

You are right, it won't help you if the program is no longer on the
stack. I am not sure what you are trying to accomplish, but when
I send an error message, I actually send two copies. One to the
program receiving the error so that I can know what program
received an error, the statement, etc. and one message to the
initial program for the job. This lets a programmer see what
has happened and allows programs to communicate message
up and down the stack.

To do what you are looking for, I would consider using the
iSeries-toolkit SndMsg procedure and add a call to the
retrieve job stack procedure in that program if some flag is set.
I would then write a message to a userspace, or ? showing
who sent what. You could then pull the message information
about the sender. The storage toolkit procedures that is
part of the iSeries-toolkit, makes building a userspace list
pretty easy.

You might have something like:

    callp            logmsgcaller(*on)
    callp(e)        PgmA
    if                  %error
    callp            rcvEscMsg
...
    callp            logmsgcaller(*clear)


David Morris

>>> jtaylor@rpg2java.com 04/18/02 12:24PM >>>

>From David Morris:

> The open source and free iSeries-toolkit at www.iseries-toolkit.org
> has pretty extensive support for job stacks. It can use the retrieve
> job stack entry to get the caller's library, activation group,
module,
>
> etc. The message toolkit has some procedures that give you back
> information based on the send message receive message technique.

I don't think it would work. Here's some typical code:

    callp(e)        PgmA
    if                  %error
    callp            rcvEscMsg

By the time I figure out that an error has occurred, PgmA is no longer
on
the call stack.

Or have I missed something?


Regards,

John Taylor



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.