Version 6.3.1
 —  Command Reference  —

CL Command (Close User Session)

This document covers the following topics:


Function and Use

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:

graphics/cl_1.png

CL Command, Procedure Flow

graphics/cl_2.png

CL Command, Procedure Flow (continued)

Control Block

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 Areas

Buffer  
Format Buffer $ */–
Record Buffer $ F/U
Search Buffer –/–
Value Buffer –/–
ISN Buffer –/–
Formats:
A alphanumeric
B binary
x/y before/after Adabas call - x and y can take the values:
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.

Top of page

Control Block

Command Code

CL

Command ID

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.

Response Code

Adabas returns the response code for the command in this field. Response code 0 indicates that the command was executed successfully.

Record Buffer Length (ACB only)

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.

Command Option 2

An `E' in this field indicates that user data provided in the record buffer is to be stored in an Adabas system file.

Additions 2

For some response codes, Adabas returns detailed information in this field. See Adabas Messages and Codes for further information.

Top of page

Record Buffer

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.

Top of page

Examples

Example 1:

The user program has completed all database activity and issues the CL command. No user data is to be stored.

Control Block:

Command Code          CL
Command Option 2      b (no user data is to be stored)

Example 2:

The user program issues a CL command and provides user data to be stored in an Adabas system file.

Control Block:

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)

Buffer Areas:

Record Buffer         USER 7 NORMAL END

Top of page