AT TERMINATION command

Gives z/OS® Debugger control when the application program is terminated.

Read syntax diagramSkip visual syntax diagramATTERMINATIONcommand;
command
A valid z/OS Debugger command.

Usage notes

  • The setting of the current programming language when the application program terminates might be unpredictable.
  • AT TERMINATION does not allow specification of an every_clause because termination can only occur once.
  • If this breakpoint is set in a parent enclave, it can be triggered and operated on with breakpoint commands while the application is in a child enclave.
  • When z/OS Debugger gains control, normal execution of the program is complete; however, a CALL or function invocation from z/OS Debugger can continue to perform program code. When the AT TERMINATION breakpoint gives control to z/OS Debugger:
    • Fetched load modules have not been released
    • Files have not been closed
    • Language-specific termination has been started yet no action has been taken

    In C, the user atexit() lists have already been called.

    In PL/I, the FINISH condition was already raised.

  • You are allowed to enter any command with AT TERMINATION. However, normal error messages are issued for any command that cannot be completed successfully because of lack of information about your program.
  • You can enter DISABLE AT TERMINATION; or CLEAR AT TERMINATION; at any time to disable or clear the breakpoint. It remains disabled or cleared until you reenable or reset it.
  • For a CICS® application on z/OS Debugger, this breakpoint is cleared at the end of the last process in the application. For a non-CICS application on z/OS Debugger, it is cleared at the end of a process.
  • The AT TERMINATION command cannot be used while you replay recorded statements by using the PLAYBACK commands.

Examples

  • When the program ends, check the z/OS Debugger environment to see what files have not been closed.
    AT TERMINATION DESCRIBE ENVIRONMENT;
  • When the program ends, display the message "Program has ended" and end the z/OS Debugger session. The current programming language setting is C.
    AT TERMINATION {
      LIST "Program has ended";
      QUIT;
    }

Refer to the following topics for more information related to the material discussed in this topic.