You need to redesign your program. Instead of ending, the program must
loop and wait for requests from the original ATTACH'er. I would do this
via WAIT / POST logic and a shared memory queue. If you don't want to
rewrite your current program, write a front end to it. The front end
would LINK (or COBOL dynamic CALL or SYNCH or perhaps just BASR) to your
current program, passing it the proper parameters which are currently
given to it via the ATTACH.

I am fairly sure this is how CICS does the TCB "reuse". Of course, a
major problem with this is making sure there are not "resource leaks".
I.e. every OPEN has a CLOSE. Every GETMAIN has a FREEMAIN. Every ENQ has
a DEQ. These cleanups are usually handled by task termination logic if
forgotten by the application program. And, if your current program is
COBOL or PL/I or any LE language, then the driver should be LE as well
or the startup overhead could be a consideration.

On Fri, 2010-11-19 at 21:03 -0600, Ken Moore wrote:
> I must be reading the wrong books or something.  I'm trying to find a way to 
> ATTACH a TCB and then reuse that TCB several times (to run the same 
> program) and then detach it when I'm done with it.  I need to keep it around 
> because I'm doing CICS EXCI calls under the attached TCB but I lose the EXCI 
> pipe and user environment if I can't reuse the TCB.  I'm feeling a bit 
> retarded 
> at this point.  There has to be a way, as CICS uses pooled TCBs all the time. 
> 
> Ken Moore
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: GET IBM-MAIN INFO
> Search the archives at http://bama.ua.edu/archives/ibm-main.html
-- 
John McKown
Maranatha! <><

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to