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 the last 100 records from a COBOL file. The file
contains N number of records.

Answer Posted / mobi and remya

PROCEDURE DIVISION.
PARA.
OPEN INPUT STUDFILE.
PERFORM PARA1 UNTIL EOF = 1.
DISPLAY 'TOTAL NO:OF RECORDS ' A.
COMPUTE B = A - 100.
MOVE 0 TO EOF.
CLOSE STUDFILE.
OPEN INPUT STUDFILE.
PERFORM PARA2 UNTIL EOF = 1.
CLOSE STUDFILE.
STOP RUN.
PARA1.
READ STUDFILE AT END MOVE 1 TO EOF.
COMPUTE A = A + 1.
PARA2.
READ STUDFILE AT END MOVE 1 TO EOF.
COMPUTE C = C + 1.
IF C >= B AND EOF NOT = 1
DISPLAY STUD-REC.

Is This Answer Correct ?    16 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is amode(24), amode(31), rmode(24) and rmode(any)?

1145


1.give the details about WHEN OTHER. 2. how many form are available in evaluate.

2108


) how do u code after getting data?

2150


What happens when we move a comp-3 field to an edited (say z (9). Zz-)?

1407


What are the rules of the move verb?

1266


What is the difference between perform … with test after and perform … with test before?

1440


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

1328


What is rmode(any) ?

1262


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

1370


What are all the divisions of a COBOL program?

1214


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

3261


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

2482


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

1186


How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?

2469


What is the utilization of copybook in cobol? Could we utilize a similar copybook?

1232