First you should know how a header in a DBF is build. It starts with 32 bytes of information which contains the amount of fields, etc. Then for each field there is also a header of 32 bytes. Afther that there is a record with a delete marker, without a carriage return. In the old Dbase books, the format is perfectly explained.
If you have a binairy editor, you can just take the header off and put it apart. You can write in COBOL your records with an extra byte in front, without the carriage-return linefeeds. With the copy /b command, you can put your COBOL output and the header together. Example:
COPY /B HEADER + MYOUTPUT MYDBASE.DBF
An other option is to write the fields out of your COBOL environment into a comma delimited file. Than you read it into Excel which can save as DBF.
You can also import the text file into your FoxBase environment by a command something like APPEND FROM
but I am afraid that I am not a DBF guy. I have a Realia program that converts DBF files into a sequential text file.
You can mail me if you need such a program. But it is not for free... That was a few days work!
I have also something that converts DBF headers into a working-storage definition.
There is a great CD from Dr. Dobbs Journal with file formats, which explains also all about the DBF stuff.
I have a COBOL program written for Realia (imagine that!) with a MF version that demonstrates how to create a DBF file -- but not the reverse!
Anyway, If you want to do the conversion and you can program in COBOL it's not too hard. If you don't have the COBOL source and just want to convert the file - it's a virtually impossible task -- you cannot determine the file layout.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.