Thanks, but the EXTR handles termination of the SUBTASK being attached, not the MAIN task ======================================== Hi Victor - Look at the EXTR parameter in the ATTACH(X) documentation. This end-of-task exist gets control on normal and abnormal end-of-task.
You can issue the DETACH macro from within this exit. Sam On Thu, Oct 16, 2014 at 11:00 AM, Victor Gil <victor....@broadridge.com> wrote: > Hi everyone, > > Working on a general purpose callable subroutine to connect to a remote > DB2 subsystem and return values back to the caller. > > Since the caller may [and WILL] have established its own DB2 connection to > a local DB2 subsystem, possibly with some cursors open and DB2 locks > acquired, the subroutine must run under a different TCB. > > I have no problems attaching a subtask on a first call and connecting from > it to a remote subsystem, but I cannot force the caller [because this would > mean massive change to the existing source code] to also call me with the > "end-of-job" request, so that I can properly detach the subtask. > > And if it is not detached the main task will surely get abended. [By the > way - can't this get trapped by an ESTAE(X) and converted into RC=0?] > > Given the above scenario - does anyone have a suggestion on how to quietly > terminate both tasks without the detach? Or maybe a suggestion on ANOTHER > way of implementing the required functionality? > > Many thanks in advance! > -Victor Gil- ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN