IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Identifying Caling program name


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Suresh Uthirapathy

New User


Joined: 29 Jul 2011
Posts: 4
Location: INDIA

PostPosted: Fri Apr 18, 2014 1:25 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Fri Apr 18, 2014 1:46 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Apr 18, 2014 1:56 pm
Reply with quote

Why do you want to know where it is going back to?
Back to top
View user's profile Send private message
Suresh Uthirapathy

New User


Joined: 29 Jul 2011
Posts: 4
Location: INDIA

PostPosted: Fri Apr 18, 2014 2:03 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Fri Apr 18, 2014 2:19 pm
Reply with quote

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
View user's profile Send private message
Suresh Uthirapathy

New User


Joined: 29 Jul 2011
Posts: 4
Location: INDIA

PostPosted: Fri Apr 18, 2014 2:57 pm
Reply with quote

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
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri Apr 18, 2014 5:42 pm
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1787
Location: Bloomington, IL

PostPosted: Fri Apr 18, 2014 5:59 pm
Reply with quote

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
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri Apr 18, 2014 6:11 pm
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Apr 18, 2014 6:44 pm
Reply with quote

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
View user's profile Send private message
walter ramos neto

New User


Joined: 10 Nov 2010
Posts: 1
Location: Brazil

PostPosted: Wed Jan 21, 2015 10:20 pm
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Jan 22, 2015 12:07 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Error to invoke MPP program through B... IMS DB/DC 3
No new posts Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top