3,740 pts.
 how to set lower and higher records in CLLE
i want to set lower and higher records value using CLLE program.... or read first record and last record in cl....

Software/Hardware used:
as400 v5r3
ASKED: December 16, 2011  11:39 AM
UPDATED: February 28, 2012  2:58 PM

Answer Wiki:
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). Pradeep.
Last Wiki Answer Submitted:  December 16, 2011  12:24 pm  by  deepu9321   3,370 pts.
All Answer Wiki Contributors:  deepu9321   3,370 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Pradeep, you gave me, order wise reading operation…

i want to set lower record and higher record in clle program…

 3,740 pts.

 

I didnt get you exactly.

You want to set Lower and Higher Record.

You want to set, which means Read(or you dont want to read the Record?)

I have mentioned to lower record by keeping file in Ascending order and Higher Record by keeping Descending order.
Only, One time Read will be fine, you will no need to read in sequence.
If its not the Required answer, let me know with little more explanation regarding Set Lower & Higher Record.

Pradeep.

 3,370 pts.

 

CL is not designed to do what you are asking.
You can read a file sequentialy but not randomly with just CL

 32,835 pts.

 

You could try variations of OVRDBF with different values for the POSITION() parameter.

Tom

 107,995 pts.

 

Set, I don’t understand what you mean by the use of the word set.
Perhaps, setting the range of values that will be processed by a called RPG program?

Read the first and last record in CL – that I understand, although, I cannot imagine why you would want to do that and, as discussed by others, CL isn’t a good tool to do that in. Would you want the physical first and last records or the records with lowest and highest value in a particular field. How many records would be in this file?

Why must this process be done in CL?
Phil

 44,150 pts.