Version 7.4.4
 —  Command Reference  —

ET Command: End Transaction

The ET command ends and saves the current transaction.

This document covers the following topics:


Function and Use

The ET command is used to indicate the end of a logical transaction. Each logical transaction should be secured by issuing an ET command. Subsequent restoring or backing out of any later transaction returns the database status to that set by the last successful ET command.

The ET command

The successful execution of an ET command guarantees that all the updates performed during the transaction will be applied to the database, regardless of any subsequent user or Adabas session interruption.

If an ET logic user issues an OP command after a system failure or in the middle of a transaction, Adabas automatically issues a BT command.

Top of page

Command: ET

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 --
ISN QUANTITY 21-24 binary -- A
  25-26 -- --  
RECORD BUFFER LENGTH 27-28 binary F * U
  29-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
FORMAT BUFFER * *** --
RECORD BUFFER * F U
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 of ET data to be stored
** Required for hold ISN option; optional for multifetch option
*** Not used but must be included in parameter list of call statement if ET data is to be stored
**** A database ID is only necessary if you are accessing multiple databases and need to limit the command operation to a specific database.
-- Not used

Top of page

Control Block

Command Code

ET

Command ID

Adabas returns either binary zeros or the transaction sequence number in this field.

If the ET command completes a transaction without update commands (that is, A1, E1, N1, N2), Adabas returns binary zeros.

Otherwise, Adabas returns the transaction sequence number in binary format. These numbers are assigned in ascending sequence during a given user session, starting with 1.

File Number

A database ID is only necessary if you are accessing multiple databases and need to limit the command operation to a specific database.

Response Code

Adabas returns the response code for the command in this field. Response code 0 indicates that the command was executed successfully. If the ET 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 Quantity

In this field, Adabas returns the transaction duration time specified in timer units (each unit equals 1.05 seconds).

Record Buffer Length

If user data are to be stored in an Adabas system file, the number of bytes of user data to be stored must be specified in this field.

Adabas will store the number of bytes specified in this field. The maximum number of bytes which may be specified is 2000 bytes.

If no user data are to be stored, this field is not used.

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).

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 ET command execution, Adabas releases all ISNs currently held by the user.

Option Description
P places all or a portion of the 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 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 and each following eight-byte group is interpreted as one file number/ISN identifier of records to be released from hold status.
Command Option 2: Store User Data
Option Description
E indicates that user data is to be stored in an Adabas system file.

Top of page

Buffers

Record Buffer

The user data to be stored in an Adabas system file are provided in this buffer.

The data will be retained until the next ET or CL command containing ET data is issued by this user. The user data will be retained when the user session terminates only if the user issued an OP command in which a unique, non-blank user ID was provided.

ISN Buffer

If the command option 1 field is set to "P", each ISN to be returned to hold status must be provided as a six-byte binary entry in which the first two bytes contain the number of the file in which the record is contained, and the next four bytes contain the ISN of the record to be held. Neither the file numbers nor the ISNs are checked for validity.

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 on page ).

Top of page

Examples

Example 1: ET without User Data

Control Block

Command Code ET  
Command Option 2 b no user data are to be stored

Example 2: ET with User Data

Control Block

Command Code ET  
Record Buffer Length 25 25 bytes of user data to be stored
Command Option 2 E user data to be stored

Buffer Areas

Record Buffer USER DATA FOR TRANSACTION

Example 3: ET with Hold ISN Option

Control Block

Command Code ET  
ISN Lower Limit 3  
ISN Buffer Length 18  
Command Option 1 P place ISNs in hold status

Buffer Areas

ISN Buffer
000600000001 ISN 1
000600000002 ISN 2
000600000003 ISN 3

Top of page