There is no Paticular Opcode in CL for Reading Lower and Higher Record.
But, You can do this by Ordering the File in Required Order using OPNQRYF.
Eg:- If you want to Read the lower Record, You will need to create the logical view for the file in Ascending order of key field.
<pre>OPNQRYF FILE(TESTPF) KEYFLD((KFLD01 *ASCEND *N)) </pre>
If you would like to Read the Higher Record, Then, You will need to create logical view for the file in Descending order.
<pre>OPNQRYF FILE(TESTPF) KEYFLD((KFLD01 *DESCEND *N)) </pre>
You can Read the file(TESTPF) using RCVF in CL. The First Record will be the Required Record(Lower or Higher based on key field).
Last Wiki Answer Submitted: December 16, 2011 12:24 pm by deepu93213,370 pts.