Version 7.4.4
 —  Command Reference  —

BT Command: Back Out Transaction

The BT command removes database updates for ET logic users.

This document covers the following topics:


Function and Use

The BT command is used to remove all database modifications (adds, deletes, updates) performed during the user's current logical transaction. This may be necessary because of a program error or the determination that the entire transaction cannot be completed successfully. BT commands may only be issued by ET logic users.

Adabas issues an implicit ET command as the last step in the processing of a BT command. This causes the current data protection block to be physically written to the Adabas Work and the data protection log, and the release of all records which were held during the transaction.

The command option 1 field provides the "P" option to place all records listed in the ISN buffer in hold status. The "M" (multifetch) option releases a subset of the records held by the current transaction. The records to be released from hold status are specified in the ISN buffer. The first fullword in the ISN buffer specifies the number of 8-byte elements following.

The command option 2 field provides the "F" (exclude file) option to exclude a single file from backout processing. The updates performed to the file specified will not be backed out. Any records in the file that are in hold status for the user will, however, be released.

Top of page

Command: BT

User Control Block

Field Position Format Before Adabas Call After Adabas Call
  1-2 -- -- --
COMMAND CODE 3-4 alphanumeric F U
COMMAND ID 5-8 binary -- A
FILE NUMBER * 9-10 binary F * U
RESPONSE CODE 11-12 binary -- A
  13-16 -- -- --
ISN LOWER LIMIT 17-20 binary F --
  21-32 -- -- --
ISN BUFFER LENGTH ** 33-34 binary F ** U
COMMAND OPTION 1 35 alphanumeric F U
COMMAND OPTION 2 36 alphanumeric F U
  37-72 -- -- --
COMMAND TIME 73-76 binary -- A
USER AREA 77-80 -- -- U

User Buffer Areas

Buffer Before Adabas Call After Adabas Call
ISN BUFFER ** F U

where:

F Filled in by user before Adabas Call
A Filled in by Adabas
U Unchanged after Adabas call
* Required only if command option 2 is specified
** Required only if command option 1 is specified
-- Not used

Top of page

Control Block

Command Code

BT

Command ID

In this field, Adabas returns the transaction sequence number of the transaction that has been backed out. The number is returned in binary format.

File Number

If a file is to be excluded from backout processing, the number of the file to be excluded must be specified in this field, and option F must be specified in the command option 2 field.

If no file is to be excluded (option F is not specified), any value specified in the file number field is disregarded.

Note:
When using two-byte file numbers and database IDs, a X'30' must be coded in the first byte of the control block.

Response Code

In this field, Adabas returns the response code for the command. Response code 0 indicates that the command was executed successfully. If the BT command returns a non-zero response code, the rightmost two bytes of the Adabas control block, bytes 45 - 48 (additions 2 field) may contain a subcode defining the exact response code meaning. Response codes and their subcodes are defined in the Adabas Messages and Codes documentation.

ISN Lower Limit

If the hold ISNs option is specified, this field must contain the count of six-byte ISN buffer entries.

ISN Buffer Length

The ISN buffer length (in bytes). This length is required only if the hold ISNs or multifetch option is used (see the command option 1 field description). If the multifetch feature is specified, this value must be less than 32 KB.

Command Option 1 (Hold ISNs Option)

Note:
If multifetch is set with ADARUN PREFETCH=YES, the "P" option is automatically used for ET/BT commands (the "M" option is automatically used for all other commands). You cannot override this option setting by using this field.

By default as part of BT command execution, Adabas releases all ISNs currently held by the user.

Option Description
P places all or a portion of these ISNs back into hold status. The ISNs to be returned to hold status must be provided in the ISN buffer, and the ISN count must be specified in the ISN lower limit field.
M (command-level multifetch) releases only a subset instead of all of the ISNs held by the current transaction. The records to be released from hold status are specified in the ISN buffer. The first fullword in the ISN buffer specifies the number of 8-byte elements following.
Command Option 2 (Exclude File Option)
Option Description
F (exclude file) excludes the single file specified in the file number field from backout processing. The updates performed to the file specified are not backed out. However, any records in the file that are in hold status for the user are released.
blanks all files are to be included in backout processing.

Top of page

ISN Buffer

If the command option 1 field is set to "P", each ISN whose record is to be returned to hold status must be provided as a six-byte binary entry in which

If the command option 1 field is set to "M", only a subset of the records held by the current transaction are to be released. The first fullword in the ISN buffer specifies the number of 8-byte elements, and each following eight-byte group is interpreted as one file number/ISN identifier of records to be released from hold status (see the section BT/ET Multifetch Processing).

Top of page

Examples

Example 1

The current user transaction is to be backed out. All files are to be included in the backout process.

Control Block

Command Code BT  
Command Option 1 blank no ISNs are held
Command Option 2 b file exclude option not used

Example 2

The current user transaction is to be backed out. Updates made to file 4 are not to be included in the backout process.

Control Block

Command Code BT  
File Number 4 file 4 to be excluded from backout
Command Option 2 F file exclude option used

Example 3

The current user transaction is to be backed out. ISNs 1, 2, and 3 which are contained in file 6 are to be placed into hold status.

Control Block

Command Code BT  
Command Option 1 P place ISNs into hold status option
Command Option 2 b file exclude option not used

Buffer Areas

ISN Buffer
000600000001 ISN 1
000600000002 ISN 2
000600000003 ISN 2

Top of page