ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Finding a Call Stack Entry

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Finding a Call Stack Entry

    Dear All ,

    Is there any idea of finding the previous call stack entry (I mean the program which called the current program) inside the program without use of any APIs.

    I mean a simpler way like PSDS or something else.


    Regards,
    Uday

  • #2
    Re: Finding a Call Stack Entry

    Search through the archives. I'm quite sure there is an example CL which uses a SNDPGMMSG to find the caller of a trigger program. This CL also can be used to find the caller program.

    Birgitta

    Comment


    • #3
      Re: Finding a Call Stack Entry

      Hi Briggitta,

      I managed to find out the code using SNDPGMMSG from other source. Anyways thanks a lot for the help.
      Code Snippet is given below.

      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

      Comment

      Working...
      X