Using fseek() and ftell() in record files

For files opened with type=record, ftell() returns relative record numbers. The behavior of fseek() and ftell() is similar to that when you use relative byte offsets for binary files, except that the unit is a record rather than a byte. For example,
   fseek(fp,-2,SEEK_CUR);
seeks backward two records from the current position.
   fseek(fp,6,SEEK_SET);

seeks to relative record 6. You do not need to get an offset from ftell().

You cannot seek past the end or before the beginning of a file.

The first record of a file is relative record 0.

For AMODE 31 C/C++ applications repositioning within a large format sequential data set that need fseek() and ftell() to access positions beyond 2 GB - 1 record must use the large file version of fseeko() and ftello().