Please enable JavaScript to view this site.

A-Shell Reference

Navigation: Development Topics > ISAM-A > General Topics

Compressed/variable length data

Scroll Prev Top Next More

As of A-Shell 4.9.948, you have the option compressing the data records, which is essentially equivalent to supporting variable length records. The feature works by dividing the records into two parts: a fixed part (at the start of the record), followed by a variable (compressible) part which makes up the remainder of the record. The fixed part must contain all of the keys, and should probably contain most of the data, except for the parts which are likely to contain sequences of null bytes, spaces, or "0". The variable part gets compressed by collapsing contiguous sequences of those three special characters, and then the result is stored in the IDX file rather than in the DAT file. (The IDX file structure is already conducive to handling variable length chunks of information, and this allows the DAT file to continue to be made up of fixed length records).

As an example of where this might be very useful, consider a customer master record of 512 bytes, to which you want to add some comments. You could use an external storage scheme, such as INMEMO, for the comments, but the simplest scheme might be just to add it to the end of the customer file by increasing the record size from 512 to 8192 (the current maximum record size), and declaring the last 7680 bytes of the record to be compressible.

To specify compressed data records, you must build your file with ISMUTL 1.4(130) or higher. At the record size prompt, instead of specifying a single value as you would for normal fixed length records, you enter the maximum (uncompressed) size, followed by a slash, followed by the length of the fixed length header portion of the record. In the example just described, you would use "8192/512". (As with the cryptic format for specifying compressed indexes, the objective here was again to preserve compatibility with existing command files that execute ISMUTL.)