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

What is the LINKAGE SECTION used in COBOL?

1482


IF I mention stop run in CICS what happens?

2317


Explain about different table spaces.

1051


what is s000 u4087 error? please give the all error codes in cobol,jcl.

17816


What is amode(24)?

1194


Write a cobol program making use of the redefine clause.

1134


How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that

3191


Why would you use find and get rather than to obtain?

1139


What is the difference between Call and a Link?

1137


What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?

1133


What is a scope terminator give example?

1063


If you are current on the owner of a set, what is the difference between obtain next and obtain first?

1254


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

2426


What is the use of intialize verb?

1192


What are 77 levels used for?

1072