what is the query to be used in openquery file to read records in reverse from a database file

470 pts.
Tags:
AS/400
CL Commands
Open Query
V5R3
what is the query to be used in openquery file to read records in reverse from a database file that is what is similar to readp in CL opnqryf

Software/Hardware used:
v5r3

Answer Wiki

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

Sounds like you need the keyfield keyword, list each field with descending ..check help it’s desc, or something like that.
Phil

Discuss This Question: 8  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
  • Kaly
    sir thanks for your answer can any one give me the coding for that.lets say the database file name is filea. opnqryf (filea) qryslt (...........)
    470 pointsBadges:
    report
  • Kaly
    sir i can understand record lock. what is meant by object lock requests,held locks and locks waiting to be applied(wrkobjlck) why should we apply for locks
    470 pointsBadges:
    report
  • Kaly
    DCLF FILE(SURESH4001/PF004) OVRDBF FILE(PF004) SHARE(*YES) OPNQRYF FILE((PF004)) KEYFLD((ROLLNU *DESCEND)) + UNIQUEKEY(*ALL) TAG: RCVF RCDFMT(RR) MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END)) SNDUSRMSG MSG(&STUNAM) GOTO CMDLBL(TAG) END: CLOF OPNID(PF004) DLTOVR FILE(PF004) ENDPGM
    470 pointsBadges:
    report
  • Kaly
    I used the above mentioned coding in CL400 sir but error comes that CPF4174 is received by the program
    470 pointsBadges:
    report
  • Kaly
    my physical file name is pf004 and rollnu is the key field for that file and i tried to read pf004 in reverse using Opnqryf in CL400 and display the field stunam present in pf004 in reverse order
    470 pointsBadges:
    report
  • TomLiotta
    ...that CPF4174 is received by the program Then you should follow the instructions that are contained in the CPF4174 message and fix the error. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    what is meant by object lock requests,held locks and locks waiting to be applied(wrkobjlck) why should we apply for locks This is unrelated to the problem about OPNQRYF. It needs to be in a question by itself. Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    CPF4174 - OPNID You probably called this program twice - the first time left the opnid Pf004 Because it failed before it got to the END: Issue a CLOF from the command line to clear your lock Phil
    49,840 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