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

sample code for read a 2nd record from last in flatfile how
can do?

Answer Posted / abhijit

Suppose file has 100 Record

1,2,3.........................100

a) Read the file and Count the number of records into a variable
Suppose CNT_VAR = 100

b) Suppose you want to read 2nd record from Last

So Set N = 2

c) Now to find the search variable compute the below

SRC_VAR = CNT_VAR - N i.e (100 - 2)

SRC_VAR = 98

d) Now Read the file to pick 98th record from top

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how do you reference the variable block file formats from cobol programs

1242


Explain the configuration section of a cobol program with examples of syntax.

1185


How you can read the file from bottom?

1147


What is the usage of comp fields in cobol?

1178


What is a report item?

1134


Have you used comp and comp-3 in your project? And how?

2472


Can we redefine the field of x(200) to less than 200?

1362


What are INPUT PROCEDURE and OUTPUT PROCEDURE?

1289


Define static linking and dynamic linking.

1180


Explain what you understand by passing by value.

1144


Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

1111


A table has two indexes defined. Which one will be used by the SEARCH?

1281


What is the difference between Global and External Variables?

1369


how to move the records from file to array table. give with code example

2669


how to convert the recors form vsam file to db2 table tru file aid

3250