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

If we use the file level keywords like LIFO, FIFO, FCFO in a file, can we see the impact of it by doing the run query of the file? if not how can we see the impact of these keywords.

2 Answers  


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

3 Answers  


How to know the perticular record in pf with out reading?

2 Answers   Cap Gemini,


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

4 Answers  


How to change the batch job to interactive job?

0 Answers  


Suppose if a physical file is having 1000 records, but i deleted 500 records from it. Here the concern is can the size of the file changes or it remains the same... kindly help me out with thorough xplanation.... Thanks in-advance...

6 Answers   ABC, TCS,


How to know logical file belongs to which physical file without source?

1 Answers  


how to update physical files using normal logical file

4 Answers  


Last statement of any rpg program is lr?

0 Answers  


Why journalling is compulsory before commitment control?

1 Answers  


Maximum how many fields we can create under a record format of PF?

5 Answers  


Q.1 how to implement the commitment control. 2.how to control commitment control from external program.

7 Answers   IBM,


Categories