Programming Guide |
Closes the current transaction manager transaction
int sm_tm_command ("FINISH");
FINISH
contains the screen exit processing needed by the transaction manager and is called automatically on screen exit. Therefore, if you use only the default transaction manager transaction on your screen, you do not need to explicitly call this command.As part of its processing,
FINISH
closes the current transaction, which has been set with theSTART
orCHANGE
commands. In cases where you initiate a transaction by calling theSTART
command, you must also call theFINISH
command to close that transaction before closing the transaction's screen. Note that you might need to call theCHANGE
command to make the transaction active before closing it with theFINISH
command.The
FINISH
command is called after the named screen exit function and after the default screen function. AfterFINISH
, the transaction manager data structures for what had been the current transaction no longer exist.
The following procedure closes two additional transactions and then changes back to the main transaction which is assumed to have been active when the procedure is invoked and which is closed on screen exit.
proc close_tranvars main_tranmain_tran = sm_tm_pinquire(TM_TRAN_NAME)call sm_tm_command("CHANGE tran1")call sm_tm_command("FINISH")call sm_tm_command("CHANGE tran2")call sm_tm_command("FINISH")call sm_tm_command("CHANGE :main_tran")return 0Also, refer to the
START
command.