Version 7.4.4
 —  Command Reference  —

CL Command: Close User Session

The CL command ends an ET session and updates the database.

This document covers the following topics:


Function and Use

The CL command is used to terminate a user session. Software AG recommends that all user programs issue a CL command upon completion of database processing. User programs operating in single-user mode which are performing database updating must issue a CL command to ensure that all updates have been written to the database.

A CL command

A CL command issued by a user operating in single-user mode causes a physical close of the database (Associator, Data Storage, Work, and the data protection log). It is therefore not possible for a single-user mode user to follow a CL command with another command (for example, an OP command).

Top of page

Command: CL

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
ISN 13-16 binary -- A
ISN LOWER LIMIT 17-20 binary -- A
ISN QUANTITY 21-24 binary -- A
  25-26 -- -- --
RECORD BUFFER LENGTH 27-28 binary F * U
  29-35 -- -- --
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

where:

F Filled in by user before Adabas Call
A Filled in by Adabas
U Unchanged after Adabas call
* Required only if user data to be stored
** Not used but must be included in parameter list of call statement if user data 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

CL

Command ID

For ET logic users, Adabas returns the transaction sequence number of the user's last successfully executed transaction in this field. The number is provided in binary format.

Because the CL command includes an ET command (see Function and Use), it also increments the transaction sequence number by one.

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

In this field, Adabas returns the response code for the command. Response Code 0 indicates that the command was executed successfully. If the CL command returns a nonzero response code, the rightmost two bytes of the Adabas control block, additions 2 field (bytes 47 and 48) 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: Number of I/Os

Adabas returns the number of I/O operations resulting from this session's Adabas calls in this field.

ISN Lower Limit: Number of Commands

In this field, Adabas returns the number of commands issued by the user during the user session.

ISN Quantity: CPU Time

In this field, Adabas returns the amount of processor time used by this user for Adabas command processing.

The time is provided in units of 1.048576 seconds.

Record Buffer Length

If user data are 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 are to be stored, this field is not used.

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

Record Buffer

The user data to be stored are provided in this buffer. The number of bytes actually stored is determined by the value specified in the record buffer length field. The data is retained only if the user has issued an OP command in which a nonblank, unique user ID was provided. If so, the data is retained until the next ET or CL command is issued by this user in which user data are provided. If a nonblank user ID was not provided, the data cannot be retrieved in a subsequent session.

Top of page

Examples

Example 1

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

Control Block

Command Code CL  
Command Option 2 b no user data are 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 are to be stored

Buffer

Record Buffer USER 7 NORMAL END

Top of page