Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / shyam

Use OVRDBF Share(*yes)
Use the Openqry file by specified the values on opnqry file

Key field . . . . . . . . . . *NONE
Key field order . . . . . . . *DESCEND

now read file using RCVF command.

Is This Answer Correct ?    26 Yes 11 No

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

Answer / kavitha

POSDBF (*END) points to last record, wont the RCVF command sets on EOF indicator?

Is This Answer Correct ?    11 Yes 7 No

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

Answer / harkesh

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.

THIS IS ONLY THE WAY ON THE WE CAN READ PF IN REVERSE ORDER
BUT FOR THIS FILE SHOULD BE KEYED FILE.
ANOTHER WAY FOR THIS ON THE BASIS OF RRN. FIRST FIND OUT
TOTAL NO OF RECORD USING RTVMBRDSC COMMMAND IN CL PROGRAM.
THEN MOVE TOTAL NO TO RRN. THEN BY USING OVRDBF COMMAND SET
POINTER ON THE BASIS OF RRN. AND IN LOOP ON THE BASIS OF
RRN. LIKE
LOOP: OVERDBF FILENAME POINTER = &RRN
IF RRN NOT = 0
RCVF RCDFMTNAME.

RRN= RRN-1.

ELSE
ENDPGM
END-IF.

Is This Answer Correct ?    5 Yes 2 No

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

Answer / sai

Use OVRDBF Share(*yes)
Use the Openqry file by specified the values on opnqry file

Key field . . . . . . . . . . Key Field name
Key field order . . . . . . . *DESCEND

Is This Answer Correct ?    3 Yes 0 No

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

Answer / 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

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

Answer / suresh

Since the requirement is to Read from end to start, the
parameter *END should be provided to Position.

The statement should look like:

POSDBF OPNID(file name) position(*END)

Is This Answer Correct ?    16 Yes 15 No

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

Answer / amit

See Opnqryf is the right answer. Use the keyfield as told
by others. But it is not necessary to overide the file.

Is This Answer Correct ?    0 Yes 0 No

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

Answer / sajied

use posdbf opnid(file name)
position (*start)

Is This Answer Correct ?    4 Yes 26 No

Post New Answer

More RPG400 Interview Questions

steps for debugging two rpg programs????

4 Answers  


How do I link an existing logical file to it's Physical File without recompiling?

2 Answers  


1)how to do date validation in rpg? 2)how to delete dUPLICATE RECORDS?

12 Answers   IBM, Opus,


Need a sql query: retrieve all duplicate records in table?

1 Answers  


1.How to load Records of a Physical file(PF) in the reverse order, in CL program?

2 Answers   Cap Gemini,


can you debug ile rpg program using isdb?

0 Answers   IBM,


How can we override a file during runtime in RPG? Without using OVRDBF or calling a CL program

1 Answers   UST,


what is estimation? and what is the level identifier parameter in PF?

3 Answers   TCS,


write an RPG program to calculate the marks of 5 students (A,B, C, D, E)in 3 different subjects (eng, math, sci) an display on the screen

0 Answers  


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

0 Answers   iGate,


How can i keyed a flat file in RPGLE

5 Answers   IBM, Wipro,


I have a Physical File name 'File1', which is present in two libraries named 'LIB1' & 'LIB2'. These 2 libraries are listed in the library list. Would like to access data from this file from these two libraries using RPG program. How to do this, any idea?

4 Answers  


Categories