If it has been generated, the dialog service BADTACS is started whenever a terminal or a transport system application has entered an invalid transaction code. This can have any of the following reasons:
The transaction code has not been generated.
The transaction code is not assigned to any program unit.
The user does not have the authorization to call the transaction code. There can be various reasons for this, e.g.:
The transaction code is an administrator TAC but the user did not sign on with administrator privileges.
A lock code is assigned to the transaction code but the user or LTERM partner does not have the corresponding keycode.
Programming notes
The dialog service BADTACS must issue an MPUT call in accordance with the rules described in the chapter “Structure and use of UTM programs”. This MPUT call then replaces error message K009, which openUTM would generate in the absence of a BADTACS service.
At the start of a service, after the INIT call, the invalid TAC is located in the KB header, in both the KCTACAL/kcpr_tac and KCTACVG/kccv_tac fields.
If the BADTACS service is called in line mode, it will receive the full message including the first 8 bytes. If it is called in format mode, the first 8 bytes (for *formats) or 10 bytes (for +formats) are removed from the message.
Outside of a service, BADTACS can also be started with a function key if one has been generated with a return code (20Z-39Z) but no TAC (SFUNC statement, operand RET=), or if the function key has not been generated (return code 19Z). The return code is then passed with the first MGET; a message (including the first 8 bytes) can be read with the second MGET. No entry is made in the KCTACAL/kcpr_tac and KCTACVG/kccv_tac fields.
Generation notes
There must be no more than one BADTACS service per application.
The first program unit in the dialog service BADTACS must be defined during generation with the TAC statement
TAC KDCBADTC, PROGRAM=...
.
Examples of BADTACS event services in C and COBOL are given on "Example of a complete UTM application on BS2000 systems" and "Example of a complete UTM application on BS2000 systems" respectively.