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
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / raghav
You can try using pre runtime array and perform lookup operation for the desired result
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / piyush aingad
We can also use setll reade and setgt readp operation in a loop.
| Is This Answer Correct ? | 1 Yes | 0 No |
How can we override a file during runtime in RPG? Without using OVRDBF or calling a CL program
what procedure should we use to find whether the following operations are successful or not setll setgt chain read reade readp pls tell with example i'm not lazy to read the manual or not lazy to do anything.but sometimes i cannot understand the things given in manual in high level english its little bit complicated for me,i can't understand their way of writing thats why i ask these questions here and find the solution in simple words that i can understand thats the real reason sir.sorry if i had hurt you or disturbed you.please understand my situation.
What are the commands that can be executed in CLP but not in RPG? Why?
How to declare the dynamic(run time) array in rpgle? can you please give example
How to find d key field of a pf that doesn’t have source physical file?
Explain mdt?
difference betwen keywords and opcodes
wat is scan and check ? give me real time scenarios where we used these keywords in ur projects?
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?
what are the parameters of jobd?give in detail.&what are the parameters of subsystem...????
How do I link an existing logical file to it's Physical File without recompiling?
steps for debugging two rpg programs????