I have file with data as follows
data
1
2
3
4
5
I need to read 1 and 5 ,then 2 and 4 then like..
upto end of file, can any one help on this

Answer Posted / vj

1. Find the greatest RRN of the file
2. Have 2 numeric counters.
3. Initialize counter1 to 1
4. Initialize counter2 to the max RRN
5. Chain with counter1 and read the record
6. Chain with Counter2 and read the record
7. Increment counter1
8. Decrement Counter2
9. Repeat Steps 5 to 8 in loop unitl counter 1 = Counter 2
(when counter 1=counter 2) we would have reached the middle of the file

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is ment by record level identifier?

647


give an eg of ACQ-(ACQUIRE),BIT OFF,BIT ON,DEALLOC,DUMP,FEOD,FORCE,MHHZO,MHLZO,MHLLZO,MLHZO,REL,RESET,TESTZ,TESTB,TESTN----GIVE SMALL EXAMPLE TO THE OPCODES...TO UNDERSTAND FUNCTIONING...........

3272


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

671


which program rpg or cl is efficent to update a transaction onto a database file and why ?

736


How can we know running job is batch or interactive?

647






how do I play {insert rpg system here}?

579


what do you mean by an input subfile, what are the keywords required?

765


what is the procedure and explain about real time scenario.

1473


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

730


how do I preserve and clean the array?

667


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

2513


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

1291


what was the robotech rpg?

680


what is an online rpg?

722


What is difference between bind by copy and bind by reference?

1720