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 the interactive job?

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


There is one string as A B C and wanted to display string as Shri A Shri B Shri C, how we can do this in sql? If we have around 100 values in string like this, each value should be displayed with initials as Shri.

0 Answers  


What is the use of member in pf?

0 Answers  


Is Constent can be define as a key field?

3 Answers  






How to find the list of source physical files in a library?? Is there any way to get a list??

5 Answers   Infosys,


How to change the batch job to interactive job?

0 Answers  


how to eliminate the level check error

2 Answers   TCS,


what is general and type of general

1 Answers   Active Brains,


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

1 Answers  


Where the QTEMP library will get created? if the the answer is QSYS, then howcome more than one job can create same library name(QTEMP) in QSYS? what is the uniqueness of QTEMP? For example, run the below command in different workstation WRKOBJ QSYS/QTEMP And take 8 in the option to check the description. both will have different info. so where(which LIB) exactly the QTEMP is stored?

2 Answers  


how to update physical files using normal logical file

4 Answers  


Categories