how to set lower and higher records in CLLE

3790 pts.
Tags:
as400 v5r3
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • pdsathishkumar
    Pradeep, you gave me, order wise reading operation... i want to set lower record and higher record in clle program...
    3,790 pointsBadges:
    report
  • deepu9321
    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,870 pointsBadges:
    report
  • CharlieBrowne
    CL is not designed to do what you are asking. You can read a file sequentialy but not randomly with just CL
    41,380 pointsBadges:
    report
  • TomLiotta
    You could try variations of OVRDBF with different values for the POSITION() parameter. Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    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
    50,375 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following