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 |
In RPG program one file using as a PRIMARY file while running program some of the records reading twice any body know why its happening
what do you mean by an input subfile, what are the keywords required?
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?
Can more than one subfile record be displayed on one line?
what is edit word and edit code
How can i keyed a flat file in RPGLE
suppose there are 100 records and i want to read records between 60-70 how we can read this 10 records in rpg
1. What is bound-by-call and bound-by-reference? 2. Where and why is *Nomain used? 3. What are the difficulties faced by programmers when using service programs? 4. Explain the different ways of parsing and compiling XML in iSeries.
What is the difference between inner join @ outer join
Can anybody tell me the setps to create .csv file in IFS folder on AS/400. I also need to know how I can send this .csv file to PC in xls sheet.....?
How to change the name of physical members Dynamically?
how to check on which PF , the LF is dependant ?