BZIP2

Synopsis

HELP:   BZIP2 data compression technique
TYPE:   OBJECT
SYNTAX: BZIP2(LEVEL=num/FAST/LEV1/LEV2/LEV3/LEV4/LEV5/LEV6/LEV7/LEV8/LEV9/BEST/AUTO)

Description

The BZIP2 algorithm compresses chunks of data. Such a chunk can be up to 100KB, 200KB, ..., 900KB. The chunk size is selected automatically based on the internal block size (block size in KB rounded up to the next possible chunk size).

The chunk size directly correlates with the compression level. Compression levels range from 1 (fastest) to 9 (best, but slowest). Level 1 results in 100KB chunk size, level 9 in 900KB chunk size (i.e. chunk size = level*100KB). Hence, a lower level also reduces the required memory resources during compression and decompression.

Decompression of concatenated BZIP2 files is also possible. All concatenated files will be decompressed into one file. It is also possible to decompress one specific member of this concatenation by specifying the member index of the file to be decompressed:

 filename/:memberindex

If BZIP compression is used with write.record(), the file attributes cannot be stored in the BZIP2 file. The record attributes can be added in front of the record (PRNCTR=RETAIN). By default, a 4 byte length field in little endian is written in front of the data. Such a BZIP2 file can be used on record-oriented platforms to recreate the original datasets as PS-VB. You may want to use a ZIP archive or ARMOR encoding to store the file attributes (DCB) to recreate the correct record format and length.

Arguments