This statement opens a ZIP container. If a ZIP container had already been opened, it is closed again first.
By default the ZIP container is opened in read mode. If files are to be added to or deleted from it, it must be opened in write mode.
OPEN-ZIP-CONTAINER |
CONTAINER = <filename 1..54 without-gen-vers>
Name of the ZIP file to open.
CONTAINER = *LINK(...)
ZIP file to open is referenced by a link name.
LINK-NAME = <structured-name 1..8>
Link name associated to the ZIP file to open.
MODE = *READ
The ZIP file is opened in read mode. The file must exists.
MODE = *UPDATE(...)
The ZIP file is opened in write mode.
STATE = *ANY
If the specified ZIP file does not exists, it is created and opened in update mode, otherwise, it is opened in update mode.
STATE = *NEW
A new ZIP file is created and opened in update mode. If the ZIP file already exists, an error occurs and the statement is rejected.
FORMAT = *STD
If the container does not exist and must be created, i.e. when MODE=*UPDATE, the file is created in BS2000 format. If the container exists i.e. when MODE=*READ or
*UPDATE(STATE=*ANY), the file is opened in the format it has been created.
FORMAT = *BS2000
The ZIP container is opened in BS2000 format. ZIP containers in this format can only be used in a BS2000 environment.
FORMAT = *WINZIP-COMPATIBLE
The ZIP container is opened in WinZip-compatible format. ZIP containers in this format can be used in the open world as they are compatible with PKZIP V4.5.
Notes
If a ZIP container was transferred to BS2000 using openFT < V11.0, it will have SAM file format with RECORD-FORMAT=U. Before this container is opened in BS2ZIP, it must be converted to PAM file format using the CONVERT-ZIP-CONTAINER statement. In the other direction a ZIP container must be converted from PAM to SAM file format with RECORD-FORMAT=U before it can be transferred to another system using openFT < V11.0. See “CONVERT-ZIP-CONTAINER”.
An error message will be displayed when the file is not recognized as a valid ZIP file.
A ZIP container created in WINZIP-COMPATIBLE format cannot be reopened in BS2000 format and a ZIP container created in BS2000 format cannot be reopened in WINZIP-COMPATIBLE format.
A ZIP container created under Windows or Unix system can only be opened in WinZip compatible mode.
GZIP archives can only be opened in MODE=*READ. Only display or extraction is thus possible. The container format has not to be specified. Only the default FORMAT=*STD is allowed.
Opening a container while another one is currently opened leads to the close of the current one. The current one is also closed even if the open of the second one fails.
The OPEN-ZIP-CONTAINER statement cannot be interrupted by K2.
Maximum ZIP container extents reached.
The user can influence the memory space allocation of a ZIP container by means of an appropriate primary and secondary allocation when the file is created using the CREATE-FILE command. If the file does not yet exist, BS2ZIP creates the ZIP container with an initial size of 1920 PAM pages (primary allocation), and a secondary allocation of 192 PAM pages.
If the container is expected to be large, the user should define a higher secondary allocation. Otherwise there is a danger that because it is constantly being expanded the container will receive the maximum possible number of extents and can then not be expanded any more. A file created using BS2ZIP default values has a maximum size of around 120 MB.
Example of estimation
DATAFILE1 100,000pp DATAFILE2 50,000pp Total = 150,000pp
With a compression ratio of 60%, we can estimate the size of the ZIP container to 60000 PAM pages. You can estimate less than this value. So, BS2ZIP will extend the file if necessary.
Execute the following CREATE-FILE command:
/CREATE-FILE MYCONT.ZIP,SUPPORT=*PUBLIC(SPACE=*RELA(60000,100)) /START-ZIP //OPEN-ZIP-CONTAINER CONTAINER=MYCONT.ZIP,MODE=*UPDATE(STATE=*ANY) //ADD DATAFILE* //END
In the reverse direction, the initial size of 1920 PAM pages can be excessive, even if it is temporary. To avoid this problem, the user is advised to make an estimation of the resulting size, and specify adequate Space parameters in the CREATE-FILE
command. For very small libraries, the necessary primary space allocation can be as small as 6 PAM pages.If the available space is lower than 1920 PAM pages for a userid, it is necessary to create the container before opening it with BS2ZIP.
The size of a container is variable, for the same contents, depending on the manipulations that have been done, including the REORGANIZE-ZIP-CONTAINER statement.