How to read alternative records in a pf by using rpg?

Answer Posted / krishna

sample code for alternative record in a pf
fsamplepfif e disk
/free
dow not %eof(samplepf);
read samplepf;
If %eof(samplepf);
Leave;
endif;
---------;(doing some actions based on the conditions)
read samplepf;
enddo;
*inlr = *on;
/end-free

Is This Answer Correct ?    1 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how can you display specific subfile page on the screen in unequal subfile?

677


can I touch the array during treatments?

762


what is a rpg?

705


How to write record if no field or the field are different in physical file in rpgle ?

492


How many program bind in one module....

2128






What is the difference between iter and do?

680


How can we override a file during runtime in rpg?

690


what is the use of sflnxtchg?

807


When we have a file with Duplicate records and I want to read the unique record from the file. For example a file containing Emp Name as 'Ram' and there are 3 entries of it. So how to read a unique record from File?

511


what is an online rpg?

733


how do I declare a table or array in rpg iv?

739


Explain mdt?

667


can you debug ile rpg program using isdb?

741


How can we know running job is batch or interactive?

660


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

835