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

How to know whether the module is dynamical or statistical?

1134


IF I mention stop run in CICS what happens?

2371


Explain what you understand by passing by value.

1146


What is inspect in cobol ?

1293


What is the difference between PIC 9.99 and 9v99 in COBOL?

1327


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

2673


What is the usage of comp fields in cobol?

1180


Describe the cobol database components?

1169


Discuss about changing dataset name in proc.

1230


Are you comfortable in cobol or jcl?

1042


Is it possible that the redefines clause has different picture clauses compared to the one it redefined?

1146


Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?

1348


if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.

6579


What guidelines should be followed to write a structured cobol prgm?

1146


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

1096