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

How to read records which is in sequential file in reverse
order ? Exp. 1 2 3 4 5 . i want 5 4 3 2 1?please clear my
doubt any one

Answer Posted / abhishek

i am giving you pseudo code of same
suppose we have 5 records

rec-no 1-->10
rec-no 2-->1
rec-no 3-->25
rec-no 4-->35
rec-no 5-->20

read sequential file to get record count of file

close file

define an array whose size is equal to record count of file


open file

read file in loop

move current record of sequential file to last subscript of
array define above ( this can be taken care using perform
varying)

read the array starting from subscript 1 to record count

this will be similar to reading sequntial file in reverse
order.....


thanks,

Abhishek

Is This Answer Correct ?    23 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to traceback if I am getting SOC7 or SOC4 abend? List down the steps

5375


What type of SDLC u followed? Why?

1999


What are the rules of the move verb?

1272


What is the difference between comp and comp-3 usage?

1203


What are declaratives and what are their uses in cobol?

1205


How to know whether the module is dynamical or statistical?

1145


How arrays can be defined in COBOL?

1223


How do we get current date from system with century in COBOL?

1381


What is the difference between PIC 9.99 and 9v99 in COBOL?

1334


How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)

3263


Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?

1153


What are the different data types in cobol?

1449


Explain how to differentiate call by context by comparing it to other calls?

1188


What is length is cobol?

1102


how can i see junk values in dclgen or in hostvariable of comp ?

3004