Software AG Products 2.4.1 | Reference Guide | Execution Commands | Detailed Syntax | @COMPARE
 
@COMPARE
The @COMPARE command performs the logical processing on two ISN lists that have been previously created with the @FIND or @COMPARE commands with the SAVE option.
The ISN lists to be processed may not be created with the SORTED option of the @FIND command, because they must be in ascending ISN sequence. The two ISN lists must contain ISNs from the same file.
The syntax of the command is as follows:
syntax of compare
The result of the @COMPARE command is a new ISN list, stored in the ISN buffer and the WORK data set. The record buffer will automatically be presented with the first record. To access subsequent records, use the @READNEXT command with the same nnnn. The EOFnnnn indication is turned on when all the records are read or no ISNs result from a logical operation.
COMMAND-IDxxxx and COMMAND-IDyyyy are necessary keywords, where xxxx and yyyy are identify the @FIND commands that created the ISN lists.
The logical operations are AND, OR, and NOT.
If the file is protected , the use the PASSWORD parameter.
If the file is ciphered, use the CIPHER parameter, providing a valid cipher code.
The command automatically reads the first record. To hold the record, use the NOREAD option followed by a @READNEXT HOLD command.
The NOREAD option causes the command to be executed without reading the first record. This record is read during the execution of the first @READNEXT command.
The GETNEXT option causes Adabas Pre-Compiler to generate code to work with the Adabas GETNEXT option. In this case, the ISN buffer is not used. You may use PREFETCH and SECURITY BY VALUE.
For example:
@FIND5 SAVE.
@FIND8 SAVE.
@COMPARE9 COMMAND-ID5 AND COMMAND-ID8.
PERFORM READING UNTIL EOF9.
.
.
.
READING.
.
.
.
@READNEXT9.
In this example, the AND operator applies to the result of the two @FIND commands. The records are then read. @ADADCL5 and @ADADCL8 do not contain any field expressions. In @ADADCL9, the field expression defines the logical record to be read and the search criteria is not relevant.