#### 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

- `NUMBER: LEVEL=num/FAST/LEV1/LEV2/LEV3/LEV4/LEV5/LEV6/LEV7/LEV8/LEV9/BEST/AUTO - Compression level (defines block size) [AUTO]`
  - `FAST - Fastest compression (Block size = 100kb)`
  - `LEV1 - Compression level 1 (Block size = 100kb)`
  - `LEV2 - Compression level 2 (Block size = 200kb)`
  - `LEV3 - Compression level 3 (Block size = 300kb)`
  - `LEV4 - Compression level 4 (Block size = 400kb)`
  - `LEV5 - Compression level 5 (Block size = 500kb)`
  - `LEV6 - Compression level 6 (Block size = 600kb)`
  - `LEV7 - Compression level 7 (Block size = 700kb)`
  - `LEV8 - Compression level 8 (Block size = 800kb)`
  - `LEV9 - Compression level 9 (Block size = 900kb)`
  - `BEST - Best compression (Block size = 900kb)`
  - `AUTO - Automatic compression (depending on the real block size)`