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
is this a rpg channel?
how do I preserve and clean the array?
Q:Hi all,i want accurate answer with code using in built functions.please sent me code as soon as posible. I have program nmed PGM1 which '' RETRIEVE Current production date''should correctly default the production date for the user who is issuing raw materials to the manufacturing.The production date can be different from the celendra date. However, the program does not make the correct adjustment for all manufacturing plants. there is a parameter which determines the production start time e.g. 07:00 if the system time precedes this,the program subtracts one from the celendra day.This work fine when the celendar day starts after production day as it does in England,the system should be adding one to the celendar day during the overlap. unfortunately the program was desined to assumed the celendar day always starts before the production day. Change required in the program: Change the PROGRAM PGM1 to use the new parrameter to decide whether to add or subtract 1 from the celendar day when determining the production date.
How to write record if no field or the field are different in physical file in rpgle ?
what is a rpg?
What are the types of identifiers?
what is kids-rpg?
what is the rpg system?
How would display prime numbers using CL program?
What is the purpose of record level identifier?
Program to read marks of 10 students for 4 subjects and compute and display total marks and status of each student in rpg
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
can you debug ile rpg program using isdb?
Suppose we have one database file and it is used by 5 programs and in 3 program we have to add some records in datbase file s what is the impact on other program?
How many program bind in one module....