The RE command reads ET (user) data for the current user, another user, or all users.
This document covers the following topics:
The RE command reads user data that was previously stored in an Adabas system checkpoint file by a C3, CL, or ET command. The user data is returned in the record buffer. These user data may be needed for a user restart following abnormal termination of a user or Adabas session.
User data is read for the issuing user if no value is specified in the command option 1 field. The RE command reads user data stored during a previous session for the issuing user if the previous and current sessions both began with OP commands specifying the user ID.
Depending on the specified command option, the RE command reads user data for either another specific user (if that user ID is specified) or for all users.
If "I" is specified in the command option 1 field, user data stored by another user may be read if the ID of the user who stored the data is specified in the additions 1 field.
If "A" is specified in the command option 1 field, the current and the following RE commands read all user data for all user IDs in ascending logical sequence. The corresponding user ID is returned in the additions 1 field as each RE command is completed. The RE command with option "A" reads only the user data written to the checkpoint file whose transactions ended with an ET command; user data are not read for users' transactions that are not yet closed with an ET command.
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 |
ISN | 13-16 | binary | F | A |
17-26 | -- | -- | -- | |
RECORD BUFFER LENGTH | 27-28 | binary | F | U |
29-34 | -- | -- | -- | |
COMMAND OPTION 1 | 35 | alphanumeric | F | U |
36 | -- | -- | -- | |
ADDITIONS 1 | 37-44 | alphanumeric | F * | U/A ** |
ADDITIONS 2 | 45-48 | alphanumeric | -- | A |
49-72 | -- | -- | -- | |
COMMAND TIME | 73-76 | binary | -- | A |
USER AREA | 77-80 | -- | -- | U |
Buffer | Before Adabas Call | After Adabas Call |
---|---|---|
FORMAT BUFFER | *** | -- |
RECORD BUFFER | -- | A |
where:
F | Filled in by user before Adabas Call |
A | Filled in by Adabas |
U | Unchanged after Adabas call |
* | Supplied ET data user ID when command option 1 equals 1 |
** | User ID for ET data in record buffer if command option 1 equals A |
*** | Not used but must be included in parameter list of call statement |
**** | 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 |
RE
Adabas will return a transaction sequence number or binary zeros in this field.
Adabas returns binary zeros in this field if the user whose user data is to be read is not active and either no previous session exists for this user or the previous session for this user was terminated successfully with a CL command. Non-ET-logic users receive binary zeros in this field.
If the user is currently active or the previous session for the user was not terminated successfully with a CL command, Adabas returns the transaction sequence number of the last successfully completed user transaction.
A database ID is only necessary if you are accessing multiple databases and need to limit the command operation to a specific database.
Adabas returns the response code for the command in this field. Response code 0 indicates that the command was executed successfully. If command option 1 specified "A", a response code 3 indicates end-of-file for the user data. Nonzero 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 documentation.
If command option 1 specifies "A", user data is returned in logical sequence starting with this ISN. If this field specifies zero, all user data is returned.
The length of the record buffer. The length specified determines the number of bytes of user data to be returned.
If the length specified is less than the number of bytes of user data available, only the specified number of bytes are inserted in the record buffer and the rightmost bytes are truncated.
If no value is specified in the command option 1 field, user data is read for the issuing user. The RE command reads user data stored during a previous session for the issuing user if the previous and current sessions both began with OP commands specifying the user ID.
If a command option 1 value is specified, the RE command reads user data for either another specific user or for all users as follows:
Option | Description |
---|---|
I | (ID of user) reads user data stored by another user if the ID of the user who stored the data is specified in the additions 1 field. |
A | (all users)The current and following RE commands read all
user data in the record buffer for all user IDs in ascending logical (ISN) sequence. A starting ISN can be specified in the ISN field. If the ISN field specifies zero, all user data is returned. The user ID for the user data contained in the record buffer at the end of the current and each following RE operation is returned in the additions 1 field as each RE command is completed. RE reads only the user data written to the checkpoint file for users whose transactions ended with an ET command; user data are not read for users' transactions that are not yet closed with an ET command. For this option, a response code 3 returned in the response code field indicates end-of-file for the user data. |
If user data stored by another user are to be read, this field must be set to the ID of the user who stored the data. If command option 1 specifies "A", this field returns the user ID for the user data contained in the record buffer at the end of this and each following RE operation.
If an ET logic user stored the data being read, Adabas will return in this field the transaction sequence number of the user's last successfully completed transaction in which user data were stored with an ET or CL command.
If the RE command returns a non-zero response code, the rightmost two bytes of the 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.
Adabas returns the ET user data in the record buffer. If no user data was found, this contains blanks at the end of RE operation.
The user wishes to read the user's own data previously stored with an ET command.
Command Code | RE | |
---|---|---|
Record Buffer Length | 100 | 100 bytes of user data are to be read |
Command Option 1 | blank | the user data to be read were stored by this user |
ISN | 0 |
The user wishes to read user data stored by another user (user ID = USER0002).
Command Code | RE | |
---|---|---|
Record Buffer Length | 150 | 150 bytes of user data are to be read |
Command Option 1 | I | the user data to be read were stored by another user |
Additions 1 | USER0002 | ID of the user who stored the user data |
ISN | 0 |
In the following example, the user wishes to read all user data and the corresponding user ID.
Command Code | RE | |
---|---|---|
Record Buffer Length | 250 | 250 bytes of user data are to be read, per user |
Command Option 1 | A | |
ISN | 0 | read all user data |