Chasing the RB chain will identify LINK invocations, but not CALL invocation. 
With luck, everybody usees recognizable eyecatchers in their SAVE macros; if 
not, all bets are off.

Can we safely assume that all of the routines are LE enabled?






--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


________________________________________
From: IBM Mainframe Discussion List <[email protected]> on behalf of 
Mike Hochee <[email protected]>
Sent: Tuesday, September 22, 2020 4:37 PM
To: [email protected]
Subject: Re: Determining program name/number of paramaters from called COBOL 
program

If you can call a small assembler subroutine from the current COBOL pgm being 
executed (may be possible to do this in COBOL as well), use of the following 
fields should help get you current program name, callers name..., callers name, 
etc..  As mentioned, LE may make a difference, not sure. Anyway...

Curr TCB addr (PSATOLD), to curr active RB (TCBRBP), to curr CDE (RBCDE), to 
curr pgm name (CDNAME)   (you are at the end of the chain when RBCDE1=0, and 
you may have to clear the high order byte to get a valid compare)

For the name of previous caller(s)...
Curr TCB addr (PSATOLD), to curr active RB (TCBRBP), to next RB in chain 
(RBLINK), to curr CDE (RBCDE), to pgm name (CDENAME)

HTH,
Mike
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Chris Cantrell
Sent: Tuesday, September 22, 2020 3:24 PM
To: [email protected]
Subject: Determining program name/number of paramaters from called COBOL program

Caution! This message was sent from outside your organization.

Hello,

I am hoping someone out there can help me with this 'opportunity'.

In a Z/OS enterprise COBOL environment, I want to be able to retrieve the 
calling program name and the number of parms passed to the called program from 
the called program. In other words, program A is executed in my batch job and 
it calls program B passing 5 parms in the using statement. I want program B to 
be able to retrieve the program name for program A as well as the number of 
parms that were passed to it.

I think if I could get to the program stack I could probably figure it out from 
there.

Any assistance that any of you could provide would be greatly appreciated.

Thanks!

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
[email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to