Working on a program to generate .ufd files automatically from the Pro-IV file structure (FILEHDR, FILEDEF, FVARDEF).
Need to know if anyone has a chart or a resource that specs
out what the Pro-IV so-called 'CISAM' data types actually
map to for C-ISAM. I'm pretty sure that C-DEC is decimal, for example, but what is NUM-S (is it numchar or something
else)? And is Alpha a char?
Also, does anyone know any tools that do for C-ISAM files
what ispack does for Pro-ISAM? Starting to run into some
severe space problems at some customer sites.
G. B.
Jan

CISAM files
Started by Jan Makarewicz, May 17 2001 07:07 PM
2 replies to this topic
#2
Posted 17 May 2001 - 08:28 PM
Hi,
We read C-ISAM files externally.
The only types we have are COMP-3,ALPHA & ZONED.
Alpha & Zoned are both treated as char. Cant remember what COMP-3 is I'll have a search tomorrow (but its basically BCD coded, if I remember correctly).
I have written a 'Defrag' utility that defrags a C-ISAM file which also reclaims deleted unused space.
The defrag routine also has a option to 'compress' the .idx part of the file and make access faster and make it smaller. Once you have run defrag with the compress option set PROIV will continue to write compressed indexs to the file. The compression takes a bit more CPU but less disk I/O so it depends on where your bottle necks are whether it will help or not.
If you go to the 'Files' section here, by clicking on the menu at the top, under the 'Utilities' dir there is the source code in 'C' for this and another utility for C-ISAM files.
We run this program on our live system about every 6-12 months. We normally get a 15 - 20% increase in performance after doing this. We also save about 3GB of disk space from a 65GB file system.
Hope this helps,
Rob D
We read C-ISAM files externally.
The only types we have are COMP-3,ALPHA & ZONED.
Alpha & Zoned are both treated as char. Cant remember what COMP-3 is I'll have a search tomorrow (but its basically BCD coded, if I remember correctly).
I have written a 'Defrag' utility that defrags a C-ISAM file which also reclaims deleted unused space.
The defrag routine also has a option to 'compress' the .idx part of the file and make access faster and make it smaller. Once you have run defrag with the compress option set PROIV will continue to write compressed indexs to the file. The compression takes a bit more CPU but less disk I/O so it depends on where your bottle necks are whether it will help or not.
If you go to the 'Files' section here, by clicking on the menu at the top, under the 'Utilities' dir there is the source code in 'C' for this and another utility for C-ISAM files.
We run this program on our live system about every 6-12 months. We normally get a 15 - 20% increase in performance after doing this. We also save about 3GB of disk space from a 65GB file system.
Hope this helps,
Rob D
#3
Posted 18 May 2001 - 01:20 PM
Hi,
Here is how to decode a COMP3 field...
I have not touched this for sometime now, but this is a snippet from our C routines. I think it is all you need.
Here is how to decode a COMP3 field...
I have not touched this for sometime now, but this is a snippet from our C routines. I think it is all you need.
float Translator::FromComp3(void* comp3str, int predec, int postdec)
{
float value = 0.000000000000000;
int len;
int sign = 1;
int nibble = 0;
int high, low, signNibble;
float multiplier = pow(10, -postdec);
len = (predec postdec 1.0) / 2 0.5;
// Start to get last byte where the low nibble contains the sign.
GetNibbles(((unsigned char*)comp3str) len-1, high, signNibble);
if (signNibble == 13)
sign = -1;
value = high*multiplier;
nibble ;
// Loop for each byte
for (int x = len - 2; x >= 0 ; x--)
{
GetNibbles((unsigned char*)comp3str x, high, low);
nibble = 2;
// Start counting up the multiplier for the low nibble
multiplier *= 10;
value = low*multiplier;
// High nibble
multiplier *= 10;
if (nibble <= predec postdec)
{
value = high*multiplier;
}
}
return sign*value;
} // Translator::FromComp3()
void Translator::GetNibbles(void* byte, int& high, int& low)
{
high = (int) (*((unsigned char*)byte) >> 4);
low = (int) (*((unsigned char*)byte) & 0x0f);
} // Translator::GetNibbles()
Reply to this topic

0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users