S8 Command (Process ISN Lists)

#### Search Results

Search

# S8 Command (Process ISN Lists)

This document covers the following topics:

- Function and Use

- Control Block

- ISN Buffer

- Example

## Function and Use

The S8 command may be used to perform logical processing on two ISN lists which have been previously created with Sx commands.

The ISN lists to be processed must be in ISN sequence. ISN lists resulting from an S2 or S9 command which are not in ISN sequence may not be used.

The ISN lists to be used should contain ISNs from a single Adabas file.

The S8 command can be used to perform the following logical operations:

- AND. The resulting ISN list will contain those ISNs which are present in both ISN lists;

- OR. The resulting ISN list will contain those ISNs which are present in either of the ISN lists;

- NOT. The resulting ISN list will contain those ISNs which are present in the first ISN list but not present in the second ISN list.

The resulting ISNs are returned in the ISN buffer in ascending sequence.

If one or both of the original ISN lists were stored without the SAVE ISN LIST option, the list(s) will automatically be released at the end of the S8 command.

##### S8 Command, Procedure Flow

### Control Block

Field | Format |
--- | --- | ---
Call Type | B | F/U
Reserved (internal use) |  | -/-
Command Code | A | F/U
Command ID | B | F/U
File Number | B | F/U (1)
Response Code | B | F/A (1)
ISN | B | -/A
ISN Lower Limit | B | F/A
ISN Quantity | B | -/A
ISN Buffer Length (ACB only) | B | F/U
Command Option 1 | A | F/U
Command Option 2 | A | F/U
Additions 1 | A | F/U
Additions 2 | A,B | -/A
Additions 3 | A | F/A
Command Time | B | -/A
User Area |  | F/U

### Buffer Areas

Buffer |
--- | ---
Format Buffer | *
Record Buffer | *
Search Buffer | *
Value Buffer | *
ISN Buffer | –/A

> 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

>   (1) The meaning of this field depends on the value specified for "Call Type". See Calling Adabas, The Control Block for details.

## Control Block

> Command Code

>   S8

> Command ID

>   This field is used to provide a value to identify the resulting ISN list if it is to be stored on the Adabas temporary working space.

>   If the SAVE ISN LIST option is to be used, or if overflow ISNs are to be stored, a non-blank, non-zero value must be provided in this field.

>   The high-order byte of this field must not be set to hexadecimal 'FF', except when automatic command ID generation is used (see Programming Considerations, Using Command IDs for additional information).

> File Number

>   The number of the file from which the ISN lists that are to be processed were obtained.

> Response Code

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

> ISN

>   Adabas returns the first ISN of the resulting ISN list in this field. If there were no resulting ISNs, this field is not modified. This applies to both the initial call and any subsequent calls which are used to retrieve ISNs from the Adabas temporary working space.

> ISN Lower Limit

>   This field may be used in an initial Sx call to limit the resulting ISN list to those ISNs which are greater than the ISN specified in this field. If this field is set to zeros, Adabas will return all qualifying ISNs.

>   This field is also used when a group of ISNs from a saved ISN list is being retrieved from the Adabas temporary working space.

> ISN Quantity

>   As a result of an initial S8 call, Adabas returns the number of records which are contained in the resulting ISN list in this field.

>   As a result of a subsequent S8 call used to retrieve ISNs from the Adabas temporary working space, Adabas returns the number of ISNs returned in the ISN buffer.

> ISN Buffer Length (ACB only)

>   The ISN buffer length (in bytes). This length is used to determine the number of ISNs placed in the ISN buffer.

>   If this field is set to zeros, no ISNs will be inserted in the ISN buffer. This field should be set to zeros if the resulting ISN list is to be read with the GET NEXT option of the L1/L4 command, or if the command is being issued only to determine the number of qualifying records.

>   If a non-zero value is specified, it should be a multiple of 4. If it is not, Adabas will reduce the length to the next-lowest integer which is a multiple of 4.

> Command Option 1

>   An 'H' in this field invokes the SAVE ISN LIST option. This option causes Adabas to store the entire resulting ISN list on the Adabas temporary working space.

> Command Option 2

>   This field is used to indicate the logical operation that is to be performed on the ISN lists.

>   A 'D' indicates that an AND operation is to be performed. The resulting ISN list will contain those ISNs which are present in both ISN lists.

>   An 'O' indicates that an OR operation is to be performed on the ISN lists. The resulting ISN list will contain those ISNs which are present in either ISN list.

>   An 'N' indicates that a NOT operation is to be performed on the ISN lists. The resulting ISN list will contain those ISNs which are present in the first list but not in the second list.

>   An 'I' releases the CID value specified in the Command ID field as the first action taken during command execution.

> Additions 1

>   The command IDs which identify the ISN lists to be processed must be specified in this field (four bytes per command ID). Each ISN list must be currently stored on the Adabas temporary working space and should contain ISNs from the same file.

> Additions 2

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

> Additions 3

>   This field is used to provide a security password.

>   If the file to be used is not security protected, this field should be set to blanks. If the file is security protected, the user must provide a valid password.

>   Adabas sets this field to blanks during command processing to protect the integrity of any password provided.

## ISN Buffer

Adabas places the list of resulting ISNs in this buffer. Each ISN is returned as a four-byte binary number.

If the ISN buffer length is not zero, and the ISN buffer is not large enough to contain all of the resulting ISNs, and a non–blank, non–zero command ID was used, Adabas will store the overflow ISNs on the Adabas temporary working space. These ISNs may then be retrieved using further Sx calls in which the same command ID is used. See Programming Considerations, ISN List Processing, for additional information.

## Example

A logical OR operation is to be performed on two ISN lists in order to produce a third ISN list which contains ISNs present in either list. The ISN lists to be processed were stored on the Adabas temporary working space under the command IDs U020 and U021. The resulting ISN list is to be stored on the Adabas temporary working space under the Command ID U999. The SAVE ISN LIST option is to be used.

#### Control Block:

    Command Code          S8

    Command ID            U999  (the  resulting  ISN  list is to be
                                 stored under the command ID U999)

    ISN Lower Limit       0 (all of the resulting  ISNs  are to  be
                             selected)

    ISN Buffer Length     0  (no ISNs are to be returned in the ISN
                              Buffer)

    Command Option 1      H (Save ISN List option to be used)

    Command Option 2      O (an OR operation is to be performed)

    Additions 1           U020U021 (the ISN lists identified by the
                                    command  IDs  U020  and  U021  are  to be
                                    processed)

    Additions 3           bbbbbbbb (file is not security protected)

### On this page

- Function and Use
- Control Block
- ISN Buffer
- Example