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
What is ment by record level identifier?
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...........
how can you display specific subfile page on the screen in unequal subfile?
which program rpg or cl is efficent to update a transaction onto a database file and why ?
How can we know running job is batch or interactive?
how do I play {insert rpg system here}?
what do you mean by an input subfile, what are the keywords required?
what is the procedure and explain about real time scenario.
how do I declare a table or array in rpg iv?
how do I preserve and clean the array?
What is the diff bw PF/LF Name and their Record format name? what is restriction in record format then file name?
How to select highest score of each subject or how to select highest income of every month?
what was the robotech rpg?
what is an online rpg?
What is difference between bind by copy and bind by reference?