Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



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 li..

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

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 li..

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

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 li..

Answer / piyush aingad

We can also use setll reade and setgt readp operation in a loop.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More RPG400 Interview Questions

3 members in a databasefile .how to read records from all the members?????????

4 Answers   CTS,


1.String operatio such as moving the characters to the variables? 2.what are the building functions for check file longs? 3.which of the following methods will make externally describe file fields available to a program? A: A/copy statement that specifies the library file and member of the field reference file source code B: A data structure definition specification that names the file on the EXTNAME keyword C: A data structure definition specification that names the file on the IMPORT keyword? D: A Definition specification for each desired field with the REFFLD keyword

1 Answers   CSC, CTS,


what is flat file?

1 Answers   IBM,


1. If my rpg program has a date field, What extra care I have to take while compiling that RPG program? 2. If the file is keyed and I have declared the file as well as Key list properly in my program. Still am getting an error message like "Chain/reade operation is not allowed" What may be the case?

6 Answers   Virtusa,


We have job which is running as batch. It takes atleast 06 hours to complete tht job. But I wanna do tht job with in 3 hours?

0 Answers  


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

0 Answers   IBM,


Can any body give the code for this quesition? Using the following details write C-Spec code to set Name to"AMMU LABS SYSTEM" D NAME1 S 10 INZ('AMMU') D NAME2 S 10 INZ('LABS') D NAME3 S 10 INZ('SYSTEM') D NAME S 20

5 Answers  


In a particular program one file is used where override command is applied to a file, now this program calls another program where we want to use the same file but without override.How it can be done?

6 Answers   Hexaware,


what was the robotech rpg?

0 Answers   IBM,


3 members in databasefile .how to read records from all the members??

6 Answers   CTS,


How do I read records from Subfile? what is the purpose of READC explain with example?

4 Answers   IBM,


What is significance of a file designated as a Primary file in Rpg400 program....also what's use of secoundry file

1 Answers  


Categories