Compress Data (CPRDATA)

Instruction Syntax

Op Code (Hex) Operand 1
1041 Compress data template
Operand 1: Space pointer.

Bound Program Access
Built-in number for CPRDATA is 107.
         compress_data_template   : address


The instruction compresses user data of a specified length. Operand 1 identifies a template which identifies the data to be compressed. The template also identifies the result space to receive the compressed data.

The compress data template must be aligned on a 16-byte boundary. The format is as follows:

Dec Hex Field Name Data Type and Length
0 0 Source length Bin(4)
4 4 Result area length Bin(4)
8 8 Actual result length Bin(4) +
Compression algorithm
1 =
Simple TERSE algorithm
2 =
IBM LZ1 algorithm

14 E Reserved (binary 0) Char(18)
32 20 Source space pointer Space pointer
48 30 Result space pointer Space pointer
--- End ---
Note: The input value associated with template fields annotated with a plus sign (+) are ignored by the instruction; these fields are updated by the instruction to return information about instruction execution.

The data at the location specified by the source space pointer for the length specified by the source length is compressed and stored at the location specified by the result space pointer. The actual result length is set to the number of bytes in the compressed result. The source data is not modified.

The value of both the source length field and result area length field must be greater than or equal to zero. If either of these conditions is not met, a template value invalid (hex 3801) exception is signalled. If the length of the compressed result is greater than the value in the result area length field, a materialization length invalid (hex 3803) exception is signalled.

The compression algorithm field specifies the algorithm used to compress the data. The IBM LZ1 algorithm tends to produce better compression on shorter input strings than the simple TERSE algorithm. The algorithm choice is stored in the compressed output data so the Decompress Data (DCPDATA) instruction will automatically select the correct decompression algorithm.

Only scalar (non-pointer) data is compressed, so any pointers in the data to be compressed are destroyed in the output of the Compress Data instruction.

Authorization Required

  • None

Lock Enforcement

  • None


  • 06 Addressing
    • 0601 Space Addressing Violation
    • 0602 Boundary Alignment
    • 0603 Range
  • 08 Argument/Parameter
    • 0801 Parameter Reference Violation
  • 10 Damage Encountered
    • 1044 Partial System Object Damage
  • 1C Machine-Dependent
    • 1C03 Machine Storage Limit Exceeded
  • 20 Machine Support
    • 2002 Machine Check
    • 2003 Function Check
  • 22 Object Access
    • 2202 Object Destroyed
    • 2203 Object Suspended
    • 2208 Object Compressed
    • 220B Object Not Available
  • 24 Pointer Specification
    • 2401 Pointer Does Not Exist
    • 2402 Pointer Type Invalid
  • 2E Resource Control Limit
    • 2E01 User Profile Storage Limit Exceeded
  • 36 Space Management
    • 3601 Space Extension/Truncation
  • 38 Template Specification
    • 3801 Template Value Invalid
    • 3803 Materialization Length Invalid
  • 44 Protection Violation
    • 4401 Object Domain or Hardware Storage Protection Violation
    • 4402 Literal Values Cannot Be Changed