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

In COBOL programming, what is PERFORM? What is VARYING?

1204


how to refer the data field?

2318


What are the different data types in cobol?

1510


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

1325


input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.

2286


What is amode(24)?

1295


State the various causes of s0c1, s0c5 and s0c7.

1140


Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.

2196


What the difference is between continue and next sentence?

1216


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

3277


What are the different rules to perform a Search?

1139


what is the use of outrecord?

2269


How many bytes S(8) comp field occupy and its maximum value?

2189


How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?

1249


How do define dynamic array in cobol.

1185