Browse Prior Art Database

Method for Finding the Last Record in a File

IP.com Disclosure Number: IPCOM000060816D
Original Publication Date: 1986-May-01
Included in the Prior Art Database: 2005-Mar-09
Document File: 1 page(s) / 11K

Publishing Venue

IBM

Related People

Edwards, WM: AUTHOR [+2]

Abstract

The files to be merged by the "merge with file" function of DisplayWrite 3 consist of two files: description file and data file. The data file is a collection of fixed-field-length, fixed-record-length ASCII records. The data file can be created by most programming languages such as PASCAL and can run without conversion after the description file is defined. The problem comes in when the data file contains some form of "residue" following all the data records. Take PASCAL as an example. PASCAL random mode always writes out amultiple of sectors. Most of the time a file created by random PASCAL will have some zero residue following the records user generated. Since the "restart number" is supported and in order to stop merge, there is a need to know what the last record number is.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 100% of the total text.

Page 1 of 1

Method for Finding the Last Record in a File

The files to be merged by the "merge with file" function of DisplayWrite 3 consist of two files: description file and data file. The data file is a collection of fixed-field- length, fixed-record-length ASCII records. The data file can be created by most programming languages such as PASCAL and can run without conversion after the description file is defined. The problem comes in when the data file contains some form of "residue" following all the data records. Take PASCAL as an example. PASCAL random mode always writes out amultiple of sectors. Most of the time a file created by random PASCAL will have some zero residue following the records user generated. Since the "restart number" is supported and in order to stop merge, there is a need to know what the last record number is. With the residues, it is not known which record is the last one. The following algorithm describes how we determine the last record number when the residues, if any, are in the form of binary zeros. 1. Divide the file size by record length (user defines in description file). 2. Ignore the remainder, the quotient is the largest possible last record number, this gives a starting point. 3. Work backwards, checking one record at a time, until a record which is not entirely zero is found, that is, the last record.

1