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 total no of records in pf with out using sql??????

3 Answers  


what is multiple member pf

1 Answers   Active Brains,


What is the batch job?

0 Answers  


can we concate fileds in physical file? If yes how can we do?

5 Answers   Patni,


What is the interactive job? What is the batch job?

0 Answers  






How to add a field to a PF and compile it without loss of data?

7 Answers  


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

2 Answers   Cap Gemini,


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

2 Answers   Four soft,


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,


I have a PF with out any data but the dependent LF is having data?

1 Answers   HCL,


When u create a PF and did not fill up Maint parameter, then by default which access path will the system take & why

2 Answers   HCL,


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

4 Answers  


Categories