This document covers the following topics:
The CL command is used to terminate a user session. It is recommended that all user programs issue a CL command when database processing is complete.
A CL command results in:
An implicit ET command (ET logic users only);
The storing of user data in an Adabas system file (optional);
The physical writing of the current data protection block to the Adabas data protection log and WORK container;
The release of all records currently in hold status for the user, and the release of all Command ID entries (and corresponding ISN lists) assigned to the user;
The transfer of the user's data from the Adabas WORK container to an Adabas system file. This is done only if a USERID was provided with the OP command; otherwise, any user data stored in the user–data system file (written by an ET command) during the session is not retained.
Field | Format | |
---|---|---|
Call Type | B | F/U |
Reserved (internal use) | -/- | |
Command Code | A | F/U |
Command ID | B | -/A |
File Number | B | F/U (1) |
Response Code | B | F/A (1) |
Record Buffer Length (ACB only) | B | $ F/U |
Command Option 2 | A | F/U |
Additions 2 | A,B | -/A |
Command Time | B | -/A |
User Area | F/U |
Buffer | |
---|---|
Format Buffer | $ */– |
Record Buffer | $ F/U |
Search Buffer | –/– |
Value Buffer | –/– |
ISN Buffer | –/– |
A | alphanumeric |
B | binary |
A | Filled in by Adabas |
F | To be filled in by User |
U | Unchanged after Adabas call |
- | Not used |
* | Not used but must be included in parameter list of CALL statement |
$ | Only used if user data to be stored |
(1) The meaning of this field depends on the value specified for "Call Type". See Calling Adabas, The Control Block for details.
CL
If ET commands have been issued during the user session, Adabas will return the transaction sequence number of the user's last successfully executed transaction in this field. The number is provided in binary format.
If no ET command has been successfully executed during this session, this field is set to 0.
Adabas returns the response code for the command in this field. Response code 0 indicates that the command was executed successfully.
If user data is to be stored in an Adabas system file, the length of the record buffer must be specified in this field. The length specified determines the number of bytes of user data to be stored.
The maximum length which may be specified is 2000 bytes.
If no user data is to be stored, this field is not used.
An `E' in this field indicates that user data provided in the record buffer is to be stored in an Adabas system file.
For some response codes, Adabas returns detailed information in this field. See Adabas Messages and Codes for further information.
The user data which is to be stored is provided in this buffer. The number of bytes actually stored is determined by the value specified in the record buffer length field. The data will be retained only if the user has issued an OP command in which a non-blank USERID was provided. If so, the data will be retained until the user issues the next ET or CL command in which user data is provided. If a non-blank USERID was not provided, the data cannot be retrieved in a subsequent session.
The user data can be in any format and Adabas performs no conversion on it.
The user program has completed all database activity and issues the CL command. No user data is to be stored.
Command Code CL
Command Option 2 b (no user data is to be stored)
The user program issues a CL command and provides user data to be stored in an Adabas system file.
Command Code CL
Record Buffer Length 17 (17 bytes of user data to be stored)
Command Option 2 E (user data is to be stored)
Record Buffer USER 7 NORMAL END