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 know the particular record in pf with out reading?

0 Answers  


There are six records in a file and we are going to update that records and used commit operation when it complete the update but suppose when it updating the third record,a error occured and operation failed.Is previously two records will be update or whole operation will be rollback? Please confirm it.

2 Answers  


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

3 Answers  


Is it possible to create a logical file whose Physical file is not in same library?

6 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,






Define interactive jobs and batch jobs

6 Answers  


how to eliminate the level check error

2 Answers   TCS,


WHAT IS THE DIFFERENCE BETWEEN 'COLHDG' AND 'ALIAS'?

5 Answers   Accenture,


What is the purpose of the chain and setll and setgt?

0 Answers  


how to add a new field to a file without compiling it?

1 Answers  


can any one tell me what is meant by PSSR? Kindly elaborate it...

1 Answers  


How to read a pf in reverse(from last record to first) using cl?

0 Answers  


Categories