Depending on context, I'll point out that the "Entry" data structure, at position 69 has an indicator for "Control Boundary" which I find useful for finding the "caller".

d lEntry ds 256 Qualified
d entrylen 10i 0
d pgmnam 10a overlay(lEntry:25)
d pgmlib 10a overlay(lEntry:35)
d ctrlbdy n overlay(lEntry:69)

hth,
-Eric DeLong

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Michael Ryan
Sent: Tuesday, July 31, 2012 2:04 PM
To: Midrange Systems Technical Discussion
Subject: Re: QWVRCSTK with CSTK0100

Gary and Dennis...thanks for the help; I was able to get this working.

Dennis - thanks for the code. I was having a problem with program
names being 'duplicated'. Checking out your code showed me the proc
and PEP...I hadn't considered that.

- Michael

On Mon, Jul 30, 2012 at 4:23 PM, Dennis Lovelady <iseries@xxxxxxxxxxxx> wrote:
This can get complex since you are asking about a Call Stack, not an
invocation stack as in the old days. You can have PGM1 -> proc1 -> proc2 ->
PGMB -> procb -> PGMC

... and your call to QWVRCSTK will show all of those entries (plus whatever
called PGM1), not just PGM1, PGMB, PGMC. It can get complex.

Maybe my showCallStack() procedure will help you out in deciphering. Code
is at http://code.midrange.com/9c4486e042.html

Just incorporate that code into PGMC (copy, or place into module or service
program, or ...) and then add:

dummyvar = showCallStack();

into your code in PGMC where you want to show the name of PGMA... and then
examine (via debug or whatever) the result in dummyvar. (You will, of
course, have to define dummyvar. And you might want to step through the
code to see how it achieves this goal.)

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"There is a theory which states that if ever anyone discovers exactly what
the Universe is for and why it is here, it will instantly disappear and be
replaced by something even more bizarrely inexplicable.

There is another theory which states that this has already happened."
-- The Hitchhiker's Guide to the Galaxy


Seems like this should be easy. I want the name of the program that
called the program that called the program with QWRCSTK. IOW, PGMA
calls PGMB which calls PGMC which calls QWRCSTK. I want to get the name
PGMA. Which stack entry would it be? Is it backwards from where I am? I
cribbed the code...lots of examples, but I'm not getting this right.
TIA!

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


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.