How can read PF in reverse order (end to start) in CL pgm..

Answer Posted / sumit gupta

We can not read a pf in reverse order in CL/CLLE. As POSDBF
only set the pointer to *START or *END and once you set it
to *END and then do the read operation, end of file will
reach and there is not such condition(MONMSG) through which
you can read the pf in reverse order.

you can read a physical file in DESENDING ORDER. You can
first sort the physical file in decending order through
OPNQRYF using KEYFLD. This will sort your PF in decending
order based on your key field and then do the RCVF on this
file.
But for this you first need to do OVRDBF on the file.

Is This Answer Correct ?    9 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the necessary keyword needed to scroll subfile records?

706


How to select highest score of each subject or how to select highest income of every month?

1299


what is data area and how it is used in rpg program ?

758


can anybody help me to solve this problem. the program that i m checking display error message saying "Record format for file AJDSPFFD does not match model file and decimal error. how to solve this problem. The AJDSPFFD is snapshot the AJTLOG that is the audit trail list.

2283


How can we know running job is batch or interactive?

660






thanks mr.Harshad R Suryawaunshi,i'm new to as400 i think you are telling in rpgile i know only rpg400 if possible can you tell in rpg400

1898


What is the diff bw PF/LF Name and their Record format name? what is restriction in record format then file name?

2521


Please tell me how to read the records from a file with load an array of size with error conditions(The logic answer for this question is ARR is array of 99 elements Z-ADD 0 IDX *LOVAL SETLL FILE READ FILE 99 *IN99 DOWEQ *OFF IDX ANDLT 99 ADD 1 IDX MOVE FIELD ARR,IDX READ FILE 99 ENDDO).So,Please give me the complete of this code.

2056


what was the robotech rpg?

689


What is the difference between copybooks and subprocedures in as400?

814


do you use message subfiles? What are the necessary keywords required coding a message subfile?

692


what happens when sflsiz = sflpag? What are the advantages and disadvantages?

715


Assume 2 users are using the same file and first user updates some record in the file. Will the 2nd user will be able to see the updated record or not?

519


Hi Viewers can any body explain me how to update and ahange the already existed data in physical file using subfile ? please explain me with the code if possible?

4216


How do u design a physical file, when you have 2 Unique fields like for eg in A student file student ID and student examination no both are unique

551