MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

xctl after link, what will be received by the main program?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware
View previous topic :: View next topic  
Author Message
hope_wx
Beginner


Joined: 23 Jul 2006
Posts: 8
Topics: 5

PostPosted: Mon Oct 29, 2007 1:36 am    Post subject: xctl after link, what will be received by the main program? Reply with quote

Hi All

I have a problem now.

In one transaction, program A link program B and program B xctl program C. And i get it from the mannul that the cotrol will trun back to program A when program C end. The question is if the commarea between A & B and B & C is different, what will received by program A.
Back to top
View user's profile Send private message
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Mon Oct 29, 2007 2:05 am    Post subject: Reply with quote

hope_wx,

XCTL desc:
Quote:

XCTL transfers control from one application program to another at the same
logical level. The program from which control is transferred is released.
If the program to which control is transferred is not already in main
storage, it is loaded.


LINK desc:
Quote:

LINK passes control from an application program at one logical level to an
application program at the next lower logical level.
When the RETURN command is executed in the linked-to program, control i
returned to the program initiating the link at the next sequential
executable instruction.



From the above descriptions, when A links to B, A is not released. Meaning any RETURN command encountered will take the control to next executable statement in A. When B XCTLS program C, then program B gets released. This implies that the commarea B&C will be lost when the control comes back to A (RETRUN must be coded in program C).

Hope I am not missing something. As always, you can verify using any debugging tools.
_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Mon Oct 29, 2007 2:49 am    Post subject: Re: xctl after link, what will be received by the main progr Reply with quote

hope_wx wrote:
Hi All

I have a problem now.

In one transaction, program A link program B and program B xctl program C. And i get it from the mannul that the cotrol will trun back to program A when program C end. The question is if the commarea between A & B and B & C is different, what will received by program A.


hoe_wx,

In case of XCTL, the control is given back to CICS. So, I don't think program A gets control when program C ends. AFAIK, COMMAREA of B & C will not be returned to A as the program B will be released in case of XCTL.
Back to top
View user's profile Send private message Send e-mail
hope_wx
Beginner


Joined: 23 Jul 2006
Posts: 8
Topics: 5

PostPosted: Mon Oct 29, 2007 3:36 am    Post subject: Reply with quote

Hi Vkphani

i get the flow from http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dfhcap35/5.3.2?SHELF=&DT=19990708143055,
no idea if i misunderstand it or not.


Hi vivek

you said commarea B&C will lost when C complete. Then A will receive the commarea A&B or B&C?(commarea A&B not exist that time, right?)
For now, i find there's some data mismatch in C process. The commarea C received seems not exactly what B pass. I'm not sure if it's a memory address problem or something else.
Back to top
View user's profile Send private message
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Mon Oct 29, 2007 4:12 am    Post subject: Reply with quote

I'd guess that A owns the commarea it sent to B and upon return, will still have it.....
If B did not give it to C then I can't say what C will give back to A......
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Mon Oct 29, 2007 5:41 am    Post subject: Reply with quote

A will receive control at the end of C. Why? There is a stored LINK (the one invoked by A) that will receive control when C does a RETURN.

As CICS_GUY said, the commarea belongs to A. When control is returned to A, the commarea is as A defined it. The commarea defined by B will be lost upon execution of the RETURN by C because B will cease to exist.

To use the words 'commarea returned to the calling program' is false and why you are confused. The commarea is storage defined in A (or could be from someone who invoked A), belongs to A is is never 'owned' by anybody else. You can not return something of which you did not take possession.

Since C never addresses this storage (because B never provided C the addressablility to the storage in A) what ever C did to B's storage will be lost and because there is no addressability for A's storage provided to C, C can not modify A's storage.

A CALLed (or LINKed to) program can only return a return code to the invoker.

By virtue of the 'addressability provided by the CALL or LINK, the invoked program modifies the CALLer's working-storage.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group