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

how to update physical file using logucal file with example

1 Answers   Wipro,


How to find the list of source physical files in a library?

0 Answers  


pls anyone explain about compile time array,pre run time array run time array

4 Answers  


how can i know logical file belongs to which physical file without source?

3 Answers   Cap Gemini,


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

6 Answers  






what is the intractive job? what is the batch job ? how to change the batch job to interactive job?

2 Answers   Four soft,


What is the batch job?

0 Answers  


Suppose I have a pf, it contains 5 members, how to access particular member data from logical file? What is the use of member in pf?

0 Answers  


hi iam very new to as400. i had created one physical file can any one tell command to enter data in to that

9 Answers   Encore,


I had created one physical file tell me command to enter data in to?

1 Answers  


Is Constent can be define as a key field?

3 Answers  


CRTDTA AND CRTARA should be used along with?

2 Answers  


Categories