Software AG Products 2.4.1 | Reference Guide | Execution Commands | Detailed Syntax | @READNEXT
 
@READNEXT
The @READNEXT command is used in conjunction with the @FIND, @COMPARE or @SORT commands, suffixed with same identifier, nnnn. It usually follows a @FIND command, in order to read a single record from the DATA storage, according to the ISN list produced from the @FIND command (or @COMARE or @SORT).
The syntax of the command is as follows:
syntax of read next
For example:
MOVE 700101 TO V-BIRTHnnnn.
@FINDnnnn.
PERFORM RECORD-HANDLING UNTIL EOFnnnn.
.
.
RECORD-HANDLING.
IF CITYnnnn = ‘NEW YORK’ THEN . . .
.
.
.
.
@READNEXTnnnn.
Each @READNEXT automatically selects the next ISN of the list and reads the desired fields expressed in the corresponding @ADADCL command field expressions into the record buffer.
@READNEXT is activated beginning with the second ISN on the list, since the first record is read into the record buffer by the initial @FIND. If the NOREAD option of the initial @FIND was used, the command starts with the first ISN on the list.
When all records have been read according to the ISN list, and an end-of-list condition is encountered the Adabas Pre-Compiler EOF indication is turned on. Adabas Pre-Compiler automatically handles ISN management, however, for optimal performance considerations, the user should provide an adequate ISN buffer size in the corresponding @ADADCL command. If the GETNEXT option of the initial @FIND was used, it uses the Adabas GETNEXT option without the ISN buffer.
The HOLD option, which is required in ET mode, is applied when the user intends to update or delete the record and needs to prevent other users from updating it before it has been released.
When the RETURN option is used with the HOLD option, it causes the return of response code 145, if the record is already in HOLD state. If the RETURN option is used, it is immediately followed by the program checking for response code 145. Without the RETURN option, the program is placed in WAIT status, until the desired record is released.
The PASSWORD parameter is used for protected files. The user must provide an identifier containing a valid password.
The CIPHER parameter is used for ciphered files. The user must provide an identifier containing a valid cipher code.