How to read the last 100 records from a COBOL file. The file
contains N number of records.

Answer Posted / santy

let consider,
First declear 2 count variables A,B.

first count all the records i.e. N and put it into A
varialbe.

compute statement B=A-100, i.e. B=N-100

now again use the read-para untill condition B=A

and in read para incrased the value of B=B+1 after each
read.

Is This Answer Correct ?    19 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Discuss about changing dataset name in proc.

763


Which is not true about evaluate statement

1586


What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?

681


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

676


Write the code to count the sum of n natural numbers.

701






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

883


State the various causes of s0c1, s0c5 and s0c7.

665


Whats the difference between search & search ALL?

5264


What is the Purpose of Pointer in the string?

643


How did the release of cobol/370 version 1.3 improve the performance of release 1.1?

645


i want a program using by if, evaluate , string, unstring, perform, occurs?

4061


Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning

686


What is amode(31)

724


HOw can I get the negative sign while deduct high value from low value

1790


Explain about different table spaces.

650