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

Why occurs cannot be used in 01 level in COBOL?

1160


When is inspect verb is used in cobol?

1258


How can you get the ksds file records into your cobol program?

1100


please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?

2472


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

1381


i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this

1540


How you can read the file from bottom?

1158


How to remove the spaces at the end of each record in the output file of variable length, via cobol program?

1172


What are the various section in data division and briefly explain them.

1182


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?

1203


What is the difference between binary search and sequential search?

1089


Can you please let me know the centre name of INS certification in Kolkata.

2244


EXPLAIN MAIN FRAME TESTING PROCESS...HOW TO FIX THE MAINFRAME BUGS?

2548


Write down the divisions of cobol program?

1258


Write a program that uses move corresponding.

1147