Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!tektronix!ogcvax!omsvax!icalqa!hplabs!sri-unix!BLC@jpl-vax From: BLC%jpl-vax@sri-unix.UUCP Newsgroups: net.micro.cpm Subject: Structure of Dbase II Files Message-ID: <12220@sri-arpa.UUCP> Date: Sat, 1-Oct-83 21:37:00 EDT Article-I.D.: sri-arpa.12220 Posted: Sat Oct 1 21:37:00 1983 Date-Received: Thu, 6-Oct-83 21:17:52 EDT Lines: 35 From: Bruce L. Conroy STRUCTURE OF DBASE II FILES Based on an analysis of several CP/M type data files, the structure of dBase II files appears to be as follows: 1) Bytes 0 to 7; General Header Byte 0, always 2--Purpose unknown Bytes 2-3, number of records, binary, low, hi Bytes 4-6, date of last update, (mo, day, year), binary Bytes 7-8, number of bytes per record, binary, low, hi 2) Bytes 8 to 520; Field Headers 16 Bytes per Field, up to 32 Fields. Relative Byte in each Header Bytes 0-9, Name, ASCII, padded with NULLS ( as first byte marks end of Fields) Byte 10, always 0 Byte 11, Type, ASCII, C N or L Byte 12, Width, Binary, 1 for Logical Bytes 13-14, 70B9H + Sum of Widths of Preceeding Fields (Possibly an in-memory pointer) Byte 15, Decimal Places, binary, 0 for C and L Types 3) Byte 521; Normally 0, (0DH) in data base with 32 fields (this would be the first byte of a 33rd field.) 4) Bytes 522 on; Data, ASCII, Number of Bytes + 1 Bytes per Record Each Data record begins with a blank (20H), followed by the fields in order, with no intervening blanks or nulls. Thus the start of the Nth record of a file with BPR bytes per record is at byte 522 + (N - 1) * (BPR + 1) + 1. ------