Closing an application program

A VTAM® application program closes itself by issuing a CLOSE macroinstruction that specifies the program's ACB. The CLOSE macroinstruction is used in the same way as the OPEN macroinstruction. Normally, the CLOSE macroinstruction is issued in the communication part of the VTAM application program and cannot be issued from an exit routine. The CLOSE request informs VTAM to terminate the SSCP-LU session with the application program and to mark the application program as no longer active in the VTAM network. For example:
CLOSPRG     CLOSE         ACB1

When a program closes, VTAM terminates all sessions and posts any outstanding operations as complete. In addition, the application program can neither issue the SENDCMD or RCVCMD macroinstructions nor access the vector lists that the ACB points to.

For additional information on the use of CLOSE by a program operator application (POA), refer to Program operator coding requirements.

For information on the use of CLOSE with persistent LU-LU session support, see Using persistent LU-LU session support.

The application program can learn that it should close its ACB in any of the following ways:
  • The application program can determine for itself that it should close (perhaps by determining the time of day).
  • The application program can receive a special text or data request, either from an LU or from the VTAM operator, indicating that the application program should close operations.
  • The TPEND exit routine of the program can be entered, either because the VTAM operator has issued a HALT or VARY NET,INACT command or some abnormal event has caused VTAM to end, or because another instance of the application is being opened and this application needs to end as part of forced takeover processing.