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

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

When it is desirable to describe files Internally?

1690


Set on command is used for closed all opened files , initialize var and release resource , return cmd is used for return to calling program but my req. Is dnt close opened files and resource must released while doing transactions , how can i do this...?

2041


How to write record if no field or the field are different in physical file in rpgle ?

946


Interviewer asked me write down DDS for load all subfile .can anybody write dds

1703


What is file identifier where we can use?

1112


how can I tell when to replace the array?

1193


during execution, an rpg/400 program automatically follows a sequence of operations for each record that is processed. The built-in program cycle includes the following logical steps.

1199


How to handle duplicate error handling in RPG?

2275


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

1129


what is kids-rpg?

1106


explain sflclr, sflend, sfldlt, and sflcsrrrn?

1336


how do you use commitment control in rpg?

1260


What is the purpose of record level identifier?

1110


Please tell me how to read the records from a file with load an array of size with error conditions(The logic answer for this question is ARR is array of 99 elements Z-ADD 0 IDX *LOVAL SETLL FILE READ FILE 99 *IN99 DOWEQ *OFF IDX ANDLT 99 ADD 1 IDX MOVE FIELD ARR,IDX READ FILE 99 ENDDO).So,Please give me the complete of this code.

2502


Program to read marks of 10 students for 4 subjects and compute and display total marks and status of each student in rpg

1120