Skip to main content

How to find out the number of records in a file

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

There are three ways to determine the number of records in a file.

Resolution:

The record count is at offset x"40" and is 8 bytes long in the MF file, which contains the index.  You can use special op code h"0003" to read the header into the record buffer.  Refer to the documentation - File Handler, chapter 7.4 Operating Code.

rebuild -n or -f will give you the number of records, if the information is present.

The calculation for the number of records in an ISAM file is taking the length of the file and divides by the overall record length.  This is actually one byte longer than the data record.

Old KB# 2091

#netexpress
#AcuCobol
#RMCOBOL
#ServerExpress
#COBOL

0 replies

Be the first to reply!