RI Command: Release Record

The RI command releases a held record and ISN, although records are not released unconditionally, as described in Function and Use.

This document covers the following topics:


Function and Use

The RI command releases ISNs for records being held by the issuing user. The selected ISN for a single database file, or all ISNs held by the issuing user in all files can be released.

Effective with Adabas 8.2.2, records are no longer released unconditionally. If your application issues an RI command for a record that has been updated in the current transaction, Adabas will now return response code 113 (ADARSP113), or if ISN=0 was specified, response code 2 (ADARSP002). This behavior may affect how your application programs are coded. If your application programs perform updates and if they try to release updated records from hold status, they may be affected. Such application programs should be adjusted to either not issue RI commands for updated records or suppress the resulting response code 113 (ADARSP113). (The ADARUN RIAFTERUPDATE parameter can be used to suppress the response code 113 and response code 2 results, and only records that have not been updated in the current transaction will be released from hold.) In addition, if your installation has Natural installed, you must apply Natural zap NA76045 for downward compatibility, which is available using Empower.

To use this command, specify the file and ISN of the record to be released in the appropriate Adabas control block fields. Specifying zeros in the ISN field releases all the records currently being held by the user in all files.

Note:
Programs using ET logic should not release records with the RI command if any updating has been performed during the current transaction, since this could result in a loss of data integrity. ET users should release ISNs with the ET or CL commands.

ACB Interface Direct Call: RI Command

This section describes ACB interface direct calls for the RI command. It covers the following topics:

Control Block and Buffer Information

Control Block

We recommend that you set unused ACB fields to binary zeros before the direct call is initiated.

Field Position Format Before Adabas Call After Adabas Call
  1-2 -- -- --
Command Code 3-4 alphanumeric F U
  5-8 -- -- --
File Number 9-10 binary F U
Response Code 11-12 binary -- A
ISN 13-16 binary F U
  17-72 -- -- --
Command Time 73-76 binary -- A
User Area 77-80 -- -- U

Buffer Areas

None used.

where:

F Supplied by user before Adabas call
A Supplied by Adabas
U Unchanged after Adabas call
-- Not used

Control Block Field Descriptions

We recommend that you set unused ACB fields to binary zeros before the direct call is initiated.

Command Code (ACBCMD)

RI

File Number (ACBFNR)

The number of the file containing the record to be released.

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 (ACBRSP)

Adabas returns the response code for the command in this field. Response code 0 (ADARSP000) indicates that the command was executed successfully. Non-zero response codes, which can also have accompanying subcodes returned in the rightmost half of the Additions 2 field, are described in the Adabas Messages and Codes Manual documentation.

ISN (ACBISN)

The ISN of the record to be released. If an ISN value is entered, the file number must also be specified. To release all ISNs held by the user, set this field to binary zeros.

ACB Examples

Example 1

The record identified by ISN 3 in file 2 is to be released from hold status.

Control Block

Command Code RI  
File Number 2 record to be released is in file 2
ISN 3 record with ISN 3 is to be released

Example 2

Any records being held by the issuing user are to be released from hold status.

Control Block

Command Code RI  
File Number - a value in this field is ignored if the ISN field is zero
ISN 0 release ISNs for all held records from all files

ACBX Interface Direct Call: RI Command

This section describes ACBX interface direct calls for the RI command. It covers the following topics:

Control Block and Buffer Information

Control Block

We recommend that you set unused ACBX fields to binary zeros before the direct call is initiated.

Field Position Format Before Adabas Call After Adabas Call
  1-2 --- --- ---
Version Indicator 3-4 binary F U
  5-6 --- --- ---
Command Code 7-8 alphanumeric F U
  9-10 --- --- ---
Response Code 11-12 binary --- A
  13-16 --- --- ---
Database ID 17-20 numeric F U
File Number 21-24 numeric F U
  25-28 --- --- ---
ISN 29-32 binary F U
  33-50 --- --- ---
Command Option 3 51 alphanumeric F U
  52-114 --- --- ---
Error Subcode 115-116 binary --- A
  117-144 --- --- ---
Command Time 145-152 binary --- A
User Area 153-168 not applicable --- U
--- 169-193 do not touch --- ---

ABDs and Buffers

None used.

where:

F Supplied by user before Adabas call
A Supplied by Adabas
U Unchanged after Adabas call
--- Not used

Control Block Field Descriptions

We recommend that you set unused ACBX fields to binary zeros before the direct call is initiated.

Version Indicator (ACBXVER)

F2

Command Code (ACBXCMD)

RI

Response Code (ACBXRSP)

Adabas returns the response code for the command in this field. Response code 0 (ADARSP000) indicates that the command was executed successfully. Non-zero response codes, which can also have accompanying subcodes returned in the Error Subcode (ACBXERRC) field, are described in the Adabas Messages and Codes Manual documentation.

Database ID (ACBXDBID)

Use this field to specify the database ID. The Adabas call will be directed to this database.

This field is a four-byte binary field, but at this time only two-byte database IDs are supported. Therefore, the database ID should be specified in the low-order part (rightmost bytes) of the field, with leading binary zeros.

If this field is set to binary zeros, the Adabas API uses either the database ID from the ADARUN cards provided in DDCARD input data or the default database ID value provided in the LNKGBLS module linked with or loaded by the link routine.

File Number (ACBXFNR)

Use this field to specify the number of the file containing the record to be released.

This field is a four-byte binary field, but the file number should be specified in the low-order part (rightmost bytes) of the field, with leading binary zeros.

ISN (ACBXISN)

The ISN of the record to be released. If an ISN value is entered, the file number must also be specified. To release all ISNs held by the user, set this field to binary zeros.

The ACBXISN field is a four-byte binary field embedded in the eight-byte ACBXISNG field, which is not yet used. Set the high-order part of the ACBXISNG field to binary zeros.

Command Option 3: Shared Hold Status (ACBXCOP3)
Option Description
S Puts the record in shared hold status until the end of the transaction. When specified in an RI request, if the record is in exclusive hold status and has not been updated in the current transaction, it is placed in shared hold status; if it is in exclusive hold status and has been updated, it is not placed in shared hold status and the exclusive hold remains in effect.

If the same record is placed in shared hold status more than once (using the C or S options or the Q option for different read sequences), it stays in shared hold status until all of the specified hold lifetimes have expired.

For complete information about shared hold updating, read Shared Hold Status.

Error Subcode (ACBXERRC)

If the command returns a nonzero response code, this field contains a subcode defining the exact response code meaning. Response codes and their subcodes are defined in the Adabas Messages and Codes Manual documentation.