How to read a PF in reverse(from last rec to first) using CL?

Answers were Sorted based on User's Feedback



How to read a PF in reverse(from last rec to first) using CL?..

Answer / harkesh

IN THIS EXAMPLE I M USING EMPFILE FOR READING IN REVERSE
ORDER.

PGM
DCLF FILE(EMPFILE)
OVRDBF FILE(EMPFILE) SHARE(*YES)
OPNQRYF FILE((EMPFILE)) KEYFLD((EMPNO *DESCEND))

READF: RCVF RCDFMT(MPFILR)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END))
GOTO READF



END:
ENDPGM

Is This Answer Correct ?    27 Yes 5 No

How to read a PF in reverse(from last rec to first) using CL?..

Answer / ankur

using opnqryf command we can read file in reverse order in CL.

Is This Answer Correct ?    5 Yes 0 No

How to read a PF in reverse(from last rec to first) using CL?..

Answer / abhijeet m

OVRDBF FILE(ABC)
MBR(ABC)
POSITION(*END)

RCVF ABC

Is This Answer Correct ?    1 Yes 10 No

Post New Answer

More DB400 Interview Questions

what is open data path? and what is the diff b/w access path and open data path?

3 Answers   Cap Gemini,


Define interactive jobs and batch jobs

6 Answers  


how to restrict upon adding the data for field reference file in DB400

1 Answers  


what is the purpus of the chain and setll and setgt ?

2 Answers   Four soft,


How to insert more than one record to a pf at a time?(Bulk insert to a pf)

9 Answers  


what is the difference between adding keys & constraints into a phisical file

4 Answers   HSBC,


what is use of self join and which cases you will use this join

1 Answers   TCS,


What is the difference between access path and open data path?

0 Answers  


How to retrieve a physical file after deleting that ? what is keyword used for that....??

6 Answers  


Hi, Please give the answer to this question? I have Phisical file with 100 records,there is no any duplicate records in this pf.Based on this pf one Logical file i have used.But this lf is viewing only 80 records only of that pf?What is the reason for this?Please give me answer?

4 Answers   IBM,


A pf containing 100 records... my query is how to display from 11th record in the pf?

3 Answers  


CRTDTA AND CRTARA should be used along with?

2 Answers  


Categories