如何解压使用 CSRCMPSC(压缩/扩展)宏或 CMPSC 主机指令压缩的数据?

问题描述 投票:0回答:1

我正在做一个大型机迁移,输入数据文件是用CMPSC指令压缩的。我正在阅读有关如何压缩/解压缩的信息:CSRCMPSC(压缩/扩展)宏和此处:Compressing and Expanding data,但它没有涉及任何细节。我正在寻找的是代码(任何语言)或一种算法来解压缩我可以在 linux 上运行的文件(我的目标语言是 Java)。我看到了对 ESA/390 数据压缩手册 (SA22-7208) 的引用,但我似乎无法在网上的任何地方找到它。任何帮助将不胜感激!

compression mainframe s390x
1个回答
0
投票

我发现 SA22-7208 here,它是“BKMGR”格式,这似乎是 IBM 专有的书籍格式。 This 是该格式的 Windows 阅读器。我能够打开这本书阅读它。

这也可能有帮助,至少对于解压器需要的东西。它来自 PKWare 的 ZIP 格式 appnote:

5.17 IBM z/OS CMPSC Compression - Method 16
-------------------------------------------

Method 16 utilizes the IBM hardware compression facility available
on most IBM mainframes.  Hardware compression can significantly 
increase the speed of data compression.  This method uses a variant 
of the LZ78 algorithm.  CMPSC hardware compression is performed
using the COMPRESSION CALL instruction.  

ZIP archives can be created using this method only on mainframes
supporting the CP instruction.  Extraction MAY occur on any
platform supporting this compression algorithm.  Use of this 
algorithm requires creation of a compression dictionary and
an expansion dictionary.  The expansion dictionary MUST be
placed into the ZIP archive for use on the system where
extraction will occur.

Additional information on this compression algorithm and dictionaries
can be found in the IBM provided document titled IBM ESA/390 Data 
Compression (SA22-7208-01). Storage requirements for using CMPSC 
compression are as follows.

The format for the compressed data stream placed into the ZIP
archive following the Local Header is:

    [dictionary header]
    [expansion dictionary]
    [CMPSC compressed data] 

If encryption is used to encrypt a file compressed with CMPSC, these 
sections MUST be encrypted as a single entity.

The format of the dictionary header is:

          Value            Size          Description
          -----            ----          -----------
          Version          1 byte        1
          Flags/Symsize    1 byte        Processing flags and
                                         symbol size
          DictionaryLen    4 bytes       Length of the 
                                         expansion dictionary

Explanation of processing flags and symbol size:

The high 4 bits are used to store the processing flags.  The low
4 bits represent the size of a symbol, in bits (values range
from 9-13).  Flag values are defined below.

    0x80 - expansion dictionary
    0x40 - expansion dictionary is compressed using Deflate
    0x20 - Reserved
    0x10 - Reserved
© www.soinside.com 2019 - 2024. All rights reserved.