To use compression, a data set must be in extended format. Only
extended-format key-sequenced data sets can be compressed. The compressed
data records have a slightly different format than logical records
in a data set that will not hold compressed data. This results in
several incompatibilities that can affect the definition of the data
set or access to records in the data set:
- The maximum record length for nonspanned data sets is three bytes
less than the maximum record length of data sets that do not contain
compressed data (this length is CISIZE-10).
- The relative byte address (RBA) of another record, or the address
of the next record in a buffer, cannot be determined using the length
of the current record or the length of the record provided to VSAM.
- The length of the stored record can change when updating a record
without any length change.
- The key and any data in front of the key will not be compressed.
Data sets with large key lengths and RKP data lengths might not be
good candidates for compression.
- Only the data component of the base cluster is eligible for compression.
Alternate indexes are not eligible for compression.
- The global shared resources (GSR) option is not permitted for
compressed data sets.
In addition to these incompatibilities, the data set must meet
certain requirements to permit compression at the time it is allocated:
- The data set must have a primary allocation of at least 5 MBs,
or 8 MBs if no secondary allocation is specified.
- The maximum record length specified must be at least key offset
plus key length plus forty bytes.
- Compressed data sets must be SMS managed. The mechanism for requesting
compression for VSAM data sets is through the SMS data class COMPACTION=Y
parameter.
Spanned record data sets require the key offset plus the key length
to be less than or equal to the control interval size minus fifteen.
These specifications regarding the key apply to alternate keys as
well as primary keys.
Compressed data sets cannot be accessed using control interval
(CI) processing except for VERIFY and VERIFY REFRESH processing and
may not be opened for improved control interval (ICI) processing.
A compressed data set can be created using the LIKE keyword and not
just using a data class.