View previous topic :: View next topic
|
Author |
Message |
Suresh Uthirapathy
New User
Joined: 29 Jul 2011 Posts: 4 Location: INDIA
|
|
|
|
Is there a way to identify the calling program, when the control is in called program. I want to know to which program the control is returned after executing the return command in called program. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
And may we know why would would need that, just write a GOBACK and it will take you back to the calling program.
However, you can pass the program name in addition during the call statement in the calling program so that called program then can know the calling program name.
I also recall of my old post which might help you.
www.ibmmainframes.com/viewtopic.php?t=57578&highlight= |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Why do you want to know where it is going back to? |
|
Back to top |
|
|
Suresh Uthirapathy
New User
Joined: 29 Jul 2011 Posts: 4 Location: INDIA
|
|
|
|
Rohit Umarjikar wrote: |
And may we know why would would need that, just write a GOBACK and it will take you back to the calling program.
However, you can pass the program name in addition during the call statement in the calling program so that called program then can know the calling program name.
I also recall of my old post which might help you.
www.ibmmainframes.com/viewtopic.php?t=57578&highlight= |
Actually iam analysing a existing program. So no coding is possible and also i dont know the sequence of programs that is calling or being called. In my program ( program x) i dont know where the control is returned after the return statement. Iam using INTERTEST tool for this analysis. I need to know if we have any EIB variable or system variable that holds the calling program name. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Quote: |
Actually iam analysing a existing program. So no coding is possible |
Why is it impossible to put diagnostics in?
Why not start at the top (transaction) and work down manually - tran relates to pgma, pgma calls/links to/whatever pgmb, pgmb calls your prog - hooray!
If pgmb can call pgmc or your prog then you need to know the data (which you should already know) so that you know which path it takes. |
|
Back to top |
|
|
Suresh Uthirapathy
New User
Joined: 29 Jul 2011 Posts: 4 Location: INDIA
|
|
|
|
Bill Woodger wrote: |
Why do you want to know where it is going back to? |
I want to know which program is calling my program. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
I dont understand frankly . Are there too many different programs that are calling/linking this sub module?
Looking from here searching the library and understanding the functionality should help you in narrowing down at the Main program |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
Pandora-Box wrote: |
I dont understand frankly . Are there too many different programs that are calling/linking this sub module? |
Quite possibly; my shop has IMS and DB2 CRUD modules that must be called by any program using that object. Moreover, that module may be at the end of a call chain half a dozen routines long, with no one except the analysts maintaining the module calling the CRUD routine knowing that it is there at all. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Akatsukami,
Yes.. What but I believe when I would do when I call DB2 CRUD commonly for "any" program ..I would ensure there is a logging happens so I would know through which program call the data got processed or atleast adding a field in the table |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Semantics are key here -
Is the sub-program truly being CALLED or is it being LINKED-TO? If the latter, ask your CICS System Programmer to run a TRACE against the target transid (CICS Transid=CETR) and then you'll see the flow.
If it is being CALLED, the CICS Trace Facility doesn't recognize this and all you'll find are CICS API's from the CALLED sub-program. You won't find an AP ENTRY Trace Statement (LE Enclave) to inform you that the flow has executed the sub-program. This is one of the drawbacks of a CALL.
TS/4.2 Trace Entries ===> publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/download/DFHS6E00.pdf?DT=20110612173106&XKS=dfhbsj11
HTH.... |
|
Back to top |
|
|
walter ramos neto
New User
Joined: 10 Nov 2010 Posts: 1 Location: Brazil
|
|
|
|
Suresh Uthirapathy wrote: |
Is there a way to identify the calling program, when the control is in called program. I want to know to which program the control is returned after executing the return command in called program. |
It may be that your doubt is much simplier... did you try to use the ASSIGN API ?
Code: |
77 GDA-NM-CHMR PIC X(8) VALUE SPACES.
77 GDA-NM-PGM-RTN PIC X(8) VALUE SPACES.
EXECUTE CICS ASSIGN
INVOKINGPROG (GDA-NM-CHMR)
RETURNPROG (GDA-NM-PGM-RTN)
NOHANDLE
END-EXEC |
Let me know if that's what you're looking for. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Walter,
The ASSIGN INVOKINGPROG API would work, providing the sub-program was accessed via an XCTL or LINK API.
Because a CALL is not a native API to CICS and if the sub-program was CALLED, then iidentifying the Caller using the ASSIGN INVOKINGPROG API would return a value from the last successful XCTL or LINK API in the Task chain.
This is one of the drawbacks of a CALL.
Welcome to the forum.
HTH.... |
|
Back to top |
|
|
|