COMPRESS
8.5C
The COMPRESS instruction compresses the logical string from a source variable into a destination variable. The instruction uses the following format:
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
source
Required. A previously defined Character String Variable that contains the input string that is compressed.
sep
Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.
dest
Required. A previously defined character variable that receives the compressed data.
Flags Affected: EQUAL, EOS, OVER
Note the following:
Only the Logical String of the {source} variable is compressed.
The {dest} variable size must be larger than the
{source} data size or the EOS flag is
set. This size difference can occur because the compression control data can make the output larger than
the non-compressed size. To insure that there is sufficient room in the {dest}
variable, the following algorithm can be used:
destlen = sourcelen + sourcelen/64
+ 19
The EOS flag is set if the {dest} variable is too small to receive all of the compressed data. In this case, the {dest} variable is set to a Null String.
The EQUAL flag is set if the {source} variable was successfully compressed and stored into {dest}.
The OVER flag is set if a recoverable compression error occurs. The {dest} variable is set to a Null String in this case.
A U42 error occurs if an internal error occurs.
See Also: Example Code, DECOMPRESS, Character String Instructions
![]() |