470 pts.
 what is the query to be used in openquery file to read records in reverse from a database file
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
ASKED: August 7, 2010  1:10 PM
UPDATED: August 9, 2010  1:25 PM

Answer Wiki:
Sounds like you need the keyfield keyword, list each field with descending ..check help it's desc, or something like that. Phil
Last Wiki Answer Submitted:  August 7, 2010  1:39 pm  by  philpl1jb   44,630 pts.
All Answer Wiki Contributors:  philpl1jb   44,630 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

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 pts.

 

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 pts.

 

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 pts.

 

I used the above mentioned coding in CL400 sir
but error comes that CPF4174 is received by the program

 470 pts.

 

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 pts.

 

…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

 110,155 pts.

 

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

 110,155 pts.

 

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

 44,630 pts.