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 fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?

2474


Difference between cobol and cobol-ii?

1283


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

3234


What is length is cobol?

1103


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?

1205


Explain how you can characterize tables in cobol?

1063


What kind of error is trapped by on size error option?

1250


How to remove 2 duplicate records and copy only one using job control language?

1224


) how do u code after getting data?

2155


Differentiate between structured cobol programming and object-oriented cobol programming.

1160


How are the next sentence and continue different from each other?

1300


What is amode(31)

1178


what is the difference between COBOL2 AND COBOL390?

3059


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

1285


What are INPUT PROCEDURE and OUTPUT PROCEDURE?

1301