The TPEND exit routine is entered for one of the following
reasons:
- The VTAM® operator issues
a HALT command.
- VTAM is halting itself
in an orderly fashion because of an internal problem.
- VTAM is being abnormally
terminated.
- The operator issues a VARY NET,INACT command for the application
program.
- A VTAM application program
with persistence enabled is being taken over.
The reason is indicated by a reason code that is passed
in the exit routine parameter list. If a nonzero code is returned
to an application with outstanding HPDT requests, the application
may be responsible for freeing some or all of its CSM buffers. See
TPEND exit considerations when sends are pending for more information.
- Reason Code
- Meaning
- 0
- A HALT command without the QUICK or CANCEL operand is indicated
by reason code 0. In this case, the application program can continue
communication on existing conversations, but the application program
should end those communications in an orderly fashion as soon as it
can. No new conversations or sessions can be established.
LU 6.2
application programs should end all conversations and then use APPCCMD
CONTROL=OPRCNTL, QUALIFY=CNOS macroinstructions to set all session
limits with all partner LUs to 0. (A CNOS issued for limits other
than 0 is rejected.) Draining of allocation requests should not be
allowed. If draining is currently in effect, turn the DRAINL bit off
in the session limits data structure specified on the CNOS request.
The application program can issue the CNOS request in the TPEND exit
routine. To do so, the application program must have some way of obtaining
the LU names of its partner LUs.
Setting the session limits
to 0 also drives the ATTN exit routine when sessions are deactivated
as a result of the CNOS. The application program should wait for notification
of the termination of its last session through the ATTN exit routine
and then issue a CLOSE macroinstruction. The ATTN exit routine does
not interrupt the TPEND exit routine. It cannot receive control until
the TPEND finishes.
The
CLOSE macroinstruction cannot be issued from either the TPEND or ATTN
exit routine. The application program must be designed so that the
mainline program issues the CLOSE. The exit routines must have a way
to set a flag or to post an ECB that tells the mainline program to
close the ACB. This might require the ATTN exit routine to know that VTAM is shutting down. It might
be necessary for the TPEND exit routine to take some action that the
ATTN exit routine can check to determine the circumstances under which
it was scheduled.
- 4
- Reason code 4 indicates that a HALT NET,QUICK command was issued
or that an operator issued a VARY NET,INACT command for the application
program. (Refer to z/OS Communications Server: SNA Operation for details on these operator commands.)
In this case, pending RPL-based operations are canceled. The application
program must not wait for the pending APPCCMDs to be completed or
try to terminate conversations on an orderly basis. The TPEND should
return to the mainline program where a CLOSE can be issued. A halt
with a reason code of 4 still allows VTAM to
continue dispatching exit routines for the application program, such
as SYNAD. The TPEND should, therefore, set a flag or post an ECB to
indicate to other exit routines that a shutdown is in progress.
- 8
- When TPEND is scheduled with a reason code of 8, indicating a
HALT CANCEL or abnormal VTAM termination,
the exit should immediately pass control back to VTAM. When VTAM returns
control to the mainline program, CLOSE should be issued. No other
exit routines are scheduled, so TPEND only needs to set an indicator
that the mainline program can recognize telling it to do a CLOSE.
- 12
- Reason code 12 indicates that an application program has issued
an OPEN ACB for the same ACB that the original application program
has opened. The code is generated when an alternate application program
takes over because the original application program must issue a CLOSE
ACB, and the original application has enabled persistence.