View previous topic :: View next topic |
Author |
Message |
hope_wx Beginner
Joined: 23 Jul 2006 Posts: 8 Topics: 5
|
Posted: Mon Oct 29, 2007 1:36 am Post subject: xctl after link, what will be received by the main program? |
|
|
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 |
|
 |
vivek1983 Intermediate

Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Mon Oct 29, 2007 2:05 am Post subject: |
|
|
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 |
|
 |
vkphani Intermediate

Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Mon Oct 29, 2007 2:49 am Post subject: Re: xctl after link, what will be received by the main progr |
|
|
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 |
|
 |
hope_wx Beginner
Joined: 23 Jul 2006 Posts: 8 Topics: 5
|
Posted: Mon Oct 29, 2007 3:36 am Post subject: |
|
|
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 |
|
 |
CICS Guy Intermediate
Joined: 30 Apr 2007 Posts: 292 Topics: 3
|
Posted: Mon Oct 29, 2007 4:12 am Post subject: |
|
|
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 |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Mon Oct 29, 2007 5:41 am Post subject: |
|
|
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 |
|
 |
|
|