View previous topic :: View next topic
|
Author |
Message |
RamsIBM
New User
Joined: 08 Jan 2007 Posts: 53 Location: Chennai
|
|
|
|
Hi Guys,
Recently I have read one CICS document in that they given purpose TGT table like below
"In case application program altered by the program itself during execution of the program for a task, the information for the program alteration will be kept in TGT table"
Can anyone tell me How can application program altered by the program itself?? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
It is possible (though strongly discouraged - even prohibited most places) to write self-modifying code. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
It would be nice to find where they got then idea that a program can modify itself |
Though self-modifying code was usually assembler, using the ALTER statement a COBOL program could change instruction execution order during the run.
Again, not permitted at most places anymore. . .
Thank goodness |
|
Back to top |
|
|
RamsIBM
New User
Joined: 08 Jan 2007 Posts: 53 Location: Chennai
|
|
|
|
Hi Enrico,
I have read in CICS user Guide PDF. In that they have given about TGT. But still am not clear how its possible.
Any guys have sample code for this?? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
The wording was very poor
http://publib.boulder.ibm.com/infocenter/cicsts/v3r1/index.jsp?topic=/com.ibm.cics.ts31.doc/dfhs1/dfhs14i.htm
from the above
Quote: |
For each invocation of the COBOL program, CICS copies the static TGT from program storage into CICS dynamic storage (the COBOL area) and uses the dynamic copy instead of the static one. CICS also copies working storage from program storage to the COBOL area, above the TGT. Task-related COBOL areas thus enable the single copy of a COBOL program to multithread as if it were truly reentrant.
|
TGT ( Task Global Table ) is related to cobol only and its inherent stupidity,
so after all the document was referring only to the data part being shuffled around for the reentrancy requirement
again in any case it is forbidden to modify the einstruction part of a running program |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
FWIW, R9 points to the TGT in a CICS transaction dump (and maybe Batch, but I'm not 100%) and at that R9 address, you'll also find a COBOL (not CICS) eyecatcher as it relates to the version/release.
Been there, done that, got the tee-shirt.
Regards,
Bill |
|
Back to top |
|
|
|