Post by Massimomi farebbe comodo la struttura del file *.DAT, poi per il programma ci
penso io.
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef struct { // MicroFocus Data File Header (variable length)
BYTE hlen[4]; // Length of the header
// First 4 bits always set to 3 indicating this
is a
// system record. Remaining bits contain the header
// length. If the max record length < 4096
bytes, length
// is 126 and is held in the next 12 bits;
otherwise is
// 124 and is held in the next 28 bits. Hence,
in a file
// with maximum record length < 4096 bytes,
this field
// contains x"30 7E 00 00". Otherwise, this field
// contains x"30 00 00 7C"
BYTE snum[2]; // Database sequence number, used by add-on
products
// supplied with COBOL system.
WORD intflag; // Integrity Flag, != 0 indicates that the file is
// corrupt. (Indexed files only)
BYTE cdat[14]; // Creation date and time in YYMMDDHHMMSSCC format.
// (Indexed files only)
BYTE res01[14]; // Reserved
BYTE res02[2]; // Reserved. Value 62 decimal; x"00 3E"
BYTE res03; // Not used. Set to zeros
BYTE org; // Organization: 1=Sequential, 2=Indexed,
3=Relative
BYTE res04; // Not used. Set to zeros
BYTE compress; // Compression routine number (0 = No compression)
BYTE res05; // Not used. Set to zeros
BYTE format; // Format (0=Default, 1=C-ISAM, 2=LEVEL II COBOL,
// 3=Indexed, 4=IDXFORMAT"4"). Used only in the
index
// file header
BYTE res06[4]; // Reserved
BYTE rec_mode; // Recording mode (0=Fixed format, 1=Variable
format)
BYTE res07[7]; // Not used. Set to zeros
WORD max_reclen; // Maximum record length
BYTE res08[2]; // Not used. Set to zeros
WORD min_reclen; // Minimum record length
BYTE res09[46]; // Not used. Set to zeros
BYTE version[4]; // Version and build data for the indexed file
handler
// creating the file. (Indexed files only)
BYTE res10[16]; // Not used. Set to zeros
} DHDR;