The BS2ZIP application enables ZIP containers to be created on BS2000 systems, and files to be added to and extracted from these containers. The ZIP compression used is the Zlib method.
This application is also able to read ZIP containers built on foreign platforms (Windows, Unix systems, Linux) provided they use the Zlib compression method and provided they are compliant with PKZIP 4.5 or GZIP.
The containers created in BS2000 can also be reopened on foreign platforms if they were created in WinZip-compatible format.
The command to start the BS2ZIP application is /START-ZIP-MANAGER or /START-ZIP.
After starting the application, the user has to open an existing container or to create a new one with the OPEN-ZIP-CONTAINER statement. In the case of the creation of a new container the user has to select the appropriate container format (operand FORMAT of the statement) according to the usage planned for the container to be created.
Please respect the following rules to select the appropriate format:
Container creation :
if you plan to use the container on BS2000 platforms only, you can create it in BS2000 format However, if you zip SAM or ISAM file including special print control characters, use the BS2000 format.
if you plan to export the container on foreign platforms, create your container in *WINZIP compatible format (default one) only.
Container open :
you don’ t need to specify the container format at open of an existing container. The program finds itself the container format. However, if you specify the format, it must be the real format of the container otherwise the OPEN-ZIP-CONTAINER statement is rejected. Once, the container is opened, you can add or extract files.
The following table summarizes the default behavior of the BS2ZIP application for the different file types according to the container open format:
ZIP Format | File Access | |||||
SAM | ISAM | PAM/PLAM | ||||
WINZIP compatible | A: | Data only are saved | A: | Data and keys are saved | A: | Binary save without any conversion |
X: | Files are extracted with same organization than the original file. | X: | Files are extracted with same organization than the original file. | X: | Files are extracted with same organization than the original file. | |
BS2000 | A: | Record length saved with data | A: | Record length saved with data | A: | Binary save |
X: | Files are extracted with same organization than the original file. | X: | Files are extracted with same organization than the original file. | X: | Files are extracted with same organization than the original file. |
A: Add
X: Extract
Using the ADD-FILE and EXTRACT-FILE statements you can modify this default behavior. See those statements for details.
Note
In the case of a WinZip-compatible container it is assumed that a CRLF (0D0A) indicates the end of a data record. The original file may not contain any such binary values, otherwise the file is “spoilt” when it is extracted. A WinZip-compatible container should not contain any non-printable SAM or ISAM files.
ADD-FILE
CHARACTER CONVERSION | Meaning |
*BY-CONTAINER-FORMAT | Default value. Behavior determined by the ZIP container open format |
*NO | No conversion is forced |
*TO-EBCDIC | EBCDIC conversion is forced (only for SAM/ISAM files in ASCII encoding) |
*TO-WIN-ANSI | WIN-ANSI conversion is forced (only for SAM/ISAM files in EBCDIC encoding) |
EXTRACT-FILE
The open format determined by ZIP container format can be modified at EXTRACT-FILE time:
DATA-TYPE | Container format | |
WINZIP-COMPATIBLE | BS2000 | |
*NOT-SPECIFIED | If no file info found in ZIP container | If no file info found |
*CHARACTER | File is extracted as a SAM file | Statement rejected |
*BINARY | File is extracted as a PAM file | Statement rejected |
*SAM-BINARY | File is extracted as a SAM file, REC-FORM=U | Statement rejected |
CHARACTER- CONVERSION | Meaning |
*BY-CONTAINER-FORMAT | Default value. Behavior determined by the ZIP container open format |
*NO | No conversion is forced |
TO-WIN-ANSI | WIN-ANSI conversion is forced (only for extraction to SAM/ISAM file) |
*TO-EBCDIC | EBCDIC conversion is forced (only for extraction to SAM/ISAM file) |
*BY-PARAMETERS(...) | Conversion will be made according to specified source and target character sets (only for extraction to SAM/ISAM file) |
*FROM-CCS | Origin coded character set, from which all characters will be converted. Supported coded character sets: WCP1252P, UTF8, ISO88591, ISO8859F (XHCS names, see manual XHCS [5] ) |
*TO-CCS | Target coded character set, to which all characters will be converted. Supported coded character sets: EDF04F, EDF041, EDF03DRV, EDF03IRV, EDF04DRV, EDF04IRV (XHCS names, see manual XHCS [5]) |
Block format when extracting to various disk formats
When extracting a file, BS2ZIP takes into account the disk format in which the file is stored, the block format (BLOCK-CONTROL-INFO) of the original file which is stored in the archive, and the specification in the BLOCK-CONTROL-INFO operand which controls whether the block format must be retained. As a result of this, in some cases the file cannot be extracted, or a block format which differs from that of the original file must be selected.
Extracting to K disks
The extracted files contain the block format of the original file.
Extracting to NK2 disks
Files with the PAMKEY block format cannot be extracted using the BLOCK-CONTROL= *KEEP option.
Depending on the archive format, the BLOCK-CONTROL=*IGNORE option is used to set the block format as follows:
Properties of the original file | Specification in the BLOCK-CONTROL operand | ||||
(BS2000 format) | (WINZIP-COMPATIBLE format) | ||||
FCB type | BLK-CTRL | *KEEP | *IGNORE | *KEEP | *IGNORE |
PAM | PAMKEY | Not extracted | NO | Not extracted | NO |
PAM | DATA | Like original | Like original | Like original | Like original |
PAM | NO | Like original | Like original | Like original | Like original |
SAM | PAMKEY | Not extracted | DATA | Not extracted | DATA |
SAM | DATA | Like original | Like original | Like original | Like original |
ISAM | PAMKEY | Not extracted | DATA2K | Not extracted | DATA2K |
ISAM | DATA | Like original | Like original | Like original | Like original |