Software AG Products 2.4.1 | Reference Guide | Execution Commands | Detailed Syntax | @READLOGICAL
 
@READLOGICAL
The @READLOGICAL command is used to read a file, or portions thereof, in logical sequential order based on the ascending or descending sequence of the values for a given descriptor, as specified in the search-criteria of the corresponding @ADADCL command, suffixed by the same nnnn identification.
The file to be read and the fields within each record which are to be read, are also specified in the @ADADCL command. Note that the descriptor specified may not be a member of a periodic group, nor may it be a phonetic descriptor.
The syntax of the command is as follows:
syntax of read logical
For example:
MOVE ‘02000300’ TO V-PERSONNEL-ID5.
@READLOGICAL5 FIRST.
PERFORM RECORD-HANDLE UNTIL E0F5.
.
.
RECORD-HANDLE.
.
.
.
@READLOGICAL5.
The FIRST option positions the sequential pass on the lowest or highest value of the desired descriptor, as specified in the value buffer. It also positions the ending value in case of specifying a range as a search criterion in the corresponding @ADADCL command. This option must be used on the first call and dropped on subsequent calls on the same pass of the file. Provide the desired value in the field V-descriptor-namennnn or V-descriptor-namennnn-F and V-descriptor-namennnn-T, of the value buffer before issuing the first @REDLOGICAL command.
If there is a requirement to stop the sequential pass and to start from another value, move the new value to the value buffer and issue the @READLOGICAL command with the FIRST option.
The ISN clause is used to position the sequential pass on the first record whose ISN is present for the value specified, provided that the ISN is greater than the ISN in the ISN field (id2). If no such ISN exists, the first record with the next higher value is read.
The DESCENDING clause indicates that the logical read should be done in descending order.
The NOSTARTVALUE clause combined with the DESCENDING clause indicates that the descending logical read should start from the bottom of the file and that the value in the value buffer should be ignored.
The NOREAD option is used with the FIRST option to perform the positioning of the sequential read without reading the first record. This record will be read during execution of the first subsequent @READLOGICAL. Note that the end of file indication will not be active with NOREAD.
The HOLD option is used in ET mode if the record is to be updated.
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, this is immediately be 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 supply an identifier containing a valid password.
The CIPHER parameter is used for ciphered files. The user must supply an identifier containing a valid cipher code.