This statement adds one or several files to the currently opened ZIP file. The statement is rejected when the ZIP container is opened in read mode.
SAM, ISAM, PAM and PLAM files are supported. Elements of a PLAM library can also optionally be added to the ZIP container.
Prior to the version V21.0B10 BS2ZIP could only store original file metadata inside of a comment associated with a particular file in archive. This file comment starts with *BS2: string, which is followed by a comma-separated list of some of the DMS properties of the original file and is referred to as "file-info" in this manual. From V21.0B10 BS2ZIP also stores some metadata associated with the file in archive inside of an extensible data field. This new metadata includes:
- CCSNAME to which the original file was converted to by BS2ZIP during ADD-FILE.
- ISO code of the CCSNAME to which original file was converted to by BS2ZIP during ADD-FILE if applicable.
- if CCSNAME to which original file was converted to by BS2ZIP during ADD-FILE is based on EBCDIC or ASCII and if is a variant of Unicode.
- Type of line delimiter used.
- if the attribute CODED-CHARACTER-SET of the original file was *NONE.
- if standard conversion was made by BS2ZIP during ADD-FILE.
- if the file was added with DATA-TYPE=*BINARY (since V21.0B30)
ADD-FILE | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
FROM-FILE =
Specifies which files or which library elements are to be added to the ZIP container. The user can select individual files from the set of files specified here by means of the operand EXCEPT-FILE-NAME.
FROM-FILE = *ALL
All the supported files of the current userid are added to the ZIP file.
FROM-FILE = *FROM-FILE(...)
The path names of the files to be added to the ZIP container are to be taken from a file. The nonprivileged caller must be owner or co-owner of this file. This list file must be a SAM file with variable-length records containing one path name per record. Lower-case characters may be used, but they will be assimilated to upper-case characters. File names must be fully qualified with or without catid or userid.
The list file can be created, for instance, by means of the DMS command SHOW-FILE-ATTRIBUTES.
LIST-FILE-NAME = <filename 1..54 without-gen-vers>
Path name of the list file.
FROM-FILE = *FROM-LIBRARY-ELEMENT(...)
The path names of the files which are to be added to the ZIP container are to be taken from a PLAM library element (type S). The library element consists of records of variable length and contains one path name per record. Lower-case characters may be used, but they will be assimilated to upper-case characters. File names must be fully qualified with or without catid or userid.
LIBRARY = <filename 1..54 without-gen-vers>
Name of the PLAM library.
ELEMENT = <composed-name 1..64 with-under>
Name of the type-S element containing the list file. The element of the highest existing version is used.
FROM-FILE = *LIBRARY-ELEMENT(...)
Elements of a PLAM library are to be added to the ZIP container. An element is fully defined by its name, its type, and the version .
LIBRARY = <filename 1..54 without-vers>
Name of the PLAM library from which elements to be added.
ELEMENT = <composed-name 1..64 with-under with-wild(132)>(...)
The specified element is added to the ZIP container if the element type is supported. Wildcards enable more than one element to be specified.
VERSION = *HIGHEST-EXISTING / *UPPER-LIMIT / <composed-name 1..24 with-under with-wild(40)>
Version of the element which is to be displayed. The default value is *HIGHEST-EXISTING, i.e. the last element in alphabetical order.
*UPPER-LIMIT specifies the highest possible version X’FF’ (displayed with the character ’@’).
If the version is specified using wildcards and library elements with the same name exist in versions which are affected by specifying wildcards, all these library elements are output.
BASE = *STD / <composed-name 1..24 with-under with-wild(40)>
Specifies the base if multiple data elements exist for the specified version.
TYPE = <alphanum-name 1..8 with-wild (12)>
Type of library element. The types D, J, M, P, S and X are supported, as well as the user-defined types based on these.
When the type is specified using wildcards, the name consists of up to 12 alphanumeric characters.
FROM-FILE = list-poss(20): <filename 1..54 without-vers with-wild(80)>
The path names of the files to be added to the ZIP container are specified directly. A list of up to 20 names may be specified.
The file names may be specified as fully or partially qualified names, with or without a catalog/user ID. If required, the file name is extended by the user ID of the request and the default catalog ID.
You can also use wildcard syntax to select the files. In this case, the supported files matching the pattern are added to the ZIP file.
If the specified file is temporary, then a shortened form can be used with '#'
TO-FILE = *BY-SOURCE
Specifies that the input files are to be registered in the container with their current name without catid or userid.
TO-FILE = *PATH-NAME(...)
The file is stored inside of the ZIP container with the specified name for this file. The operand will not interpret characters like forward slash, asterisk, square brackets and others as wildcards, but as part of the filename. Use this operand to specify a relative path name inside of zip container.
If FROM-FILE operand of ADD-FILE command uses wildcards, the input will be rejected if they return more than one item. The command can process multiple files at once if FROM-FILE operand is used with sub operands that imply that TO-FILE value is a prefix to destination filename in zip container. These sub operands of FROM-FILE include: *FROM-FILE, *FROM-LIBRARY-ELEMENT, list-poss(20).
PATH=<c-string 1..1800 with-low>
The path name of the file to be added to the ZIP container.
Example:
ADD-FILE FROM-FILE=*FROM-FILE(MYFILE),TO-FILE=*PATH-NAME('folder/prefix') is accepted.
All the file names contained in MYFILE are prefixed with folder/prefix inside of ZIP container.
TO-FILE = <c-string 1..132 with-low>
The file is stored inside of the ZIP container with the specified name for this file. Both lower and upper case characters of the operand will be accepted, because the operand is case sensitive. This operand can be used if the container is planned to be transferred to a non-BS2000 system and the file names concerned do not comply with BS2000 syntax (e.g. upper/lower case).
If wildcards are used in the FROM-FILE operand, wildcards can be used in a construction string to specify how the new names are to be formed in the container (see SDF rules for wildcard construction in the “Commands” manual [2]).
If a list of file names is specified in the FROM-FILE operand, only TO-FILE = *BY-SOURCE is accepted or a value without wildcards, but terminated by a period character (partial qualifier). In this case, the TO-FILE value is used as a prefix.
Example:
ADD-FILE FROM-FILE=*FROM-FILE(MYFILE),TO-FILE='XXX.' is accepted.
All the file names contained in MYFILE are prefixed with XXX.
TO-FILE = <composed-name 1..64 with-underscore with-wild-constr(132)>(...)
The file is stored inside of the ZIP container with the specified name for this file. The lower case characters of the operand will be accepted and changed to upper case, because the operand is not case sensitive.
If wildcards are used in the FROM-FILE operand, wildcards can be used in a construction string to specify how the new names are to be formed in the container (see SDF rules for wildcard construction in the “Commands” manual [2]).
If list of file names is specified in the FROM-FILE operand, only TO-FILE = *BY-SOURCE is accepted or a value without wildcards, but eventually terminated by a period character. In this case, the TO-FILE value is used as a prefix.
Example:
ADD-FILE FROM-FILE=*FROM-FILE(MYFILE),TO-FILE=XXX. is accepted.
All the file names contained in MYFILE are prefixed with XXX.
The default setting for library elements is that the specified name is also assigned a suffix containing the type and version of the element (format: <to-file>.<type>.<version>). The option of creating this suffix can be controlled in the following operands, which are available in TO-FILE only with <composed-name 1..64 with-underscore with-wild-constr(132)>:
WITH-VERSION = *STD / *YES / *NO
Evaluated only for library elements:
Specifies whether the suffix is to contain the element version.
*STD specifies *YES as the default.
An element with VERSION=*UPPER-LIMIT is assigned a ’U’ in the suffix instead of the character ’@’ (e.g. in the case of type S, TO-FILE=myelem1 becomes MYELEM1.U.S).
WITH-TYPE = *STD / *YES / *NO
Evaluated only for library elements:
Specifies whether the suffix is to contain the element type.
*STD specifies *YES as the default.
CHARACTER-CONVERSION = *BY-CONTAINER-FORMAT
The input files are converted according to the format of the ZIP file.
Files are converted only
- if the archive is opened in winzip compatible format
- if the original file has SAM/ISAM structure
- if the DATA-TYPE is specified to *NOT-SPECIFIED or *CHARACTER.
The standard conversion checks if the CODED-CHARACTER-SET is set to one of the values that BS2ZIP considers single byte EBCDIC encodings. They are listed in the table below. If it is one of them, then it performs a conversion from EBCDIC to ASCII. Otherwise, no conversion is applied.
Standard conversion will be applied for: |
---|
EDF03IRV EDF03DRV EDF04DRV EDF041 EDF042 EDF043 EDF044 EDF045 EDF046 EDF047 EDF049 EDF04A EDF04B EDF04C EDF04D EDF04E EDF04F EEHCL2 EEHCLC EEHCLC1 EEHCLAA EEHCLG |
Files inside winzip compatible archives with DATA-TYPE specified to *NOT-SPECIFIED or *CHARACTER and file structure of SAM or ISAM will have a line delimiter based on the encoding to which the original file was converted to or the original file encoding, if no conversion was applied, as described in the table below.
Encoding of file in archive | Line delimiter with DELIMITER = *STD / *CRLF | Line delimiter with DELIMITER = *LF | Line delimiter with DELIMITER = *NL |
---|---|---|---|
EBCDIC code (e.g. EDF041, EDF04F, UTFE) | 0D25 | 25 | 15 |
ASCII code, except UTF16 (e.g. ISO88591, ISO8859F, WCP1252, UTF8) | 0D0A | 0A | 0A |
UTF16 | 000D000A | 000A | 000A |
CHARACTER-CONVERSION = *NO
The input files are not converted.
Files inside winzip compatible archives with DATA-TYPE specified to *NOT-SPECIFIED or *CHARACTER and file structure of SAM or ISAM will have a line delimiter based on the encoding of the original file as described in the table below.
Encoding of file in archive | Line delimiter with DELIMITER = *STD / *CRLF | Line delimiter with DELIMITER = *LF | Line delimiter with DELIMITER = *NL |
---|---|---|---|
EBCDIC code (e.g. EDF041, EDF04F, UTFE) | 0D25 | 25 | 15 |
ASCII code, except UTF16 (e.g. ISO88591, ISO8859F, WCP1252, UTF8) | 0D0A | 0A | 0A |
UTF16 | 000D000A | 000A | 000A |
CHARACTER-CONVERSION = *TO-EBCDIC
The ASCII encoded input files are converted to EBCDIC before compression.
Files are converted only
- if the archive is opened in winzip compatible format
- if the original file has SAM/ISAM structure are converted
Standard conversion checks if the CODED-CHARACTER-SET is set to one of the values that BS2ZIP considers single byte EBCDIC encodings. They are listed in the table below. If it is one of them, then it performs a conversion from ISO8859F to EDF04F. Otherwise, no conversion is applied.
Standard conversion will be applied for: |
---|
ISO88591 ISO88592 ISO88593 ISO88594 ISO88595 ISO88597 ISO88599 ISO8859F WCP1252P |
Files inside winzip compatible archives with DATA-TYPE specified to *NOT-SPECIFIED or *CHARACTER and file structure of SAM or ISAM will have a line delimiter based on the encoding to which the original file was converted to or the original file encoding, if no conversion was applied, as described in the table below.
Encoding of file in archive | Line delimiter with DELIMITER = *STD / *CRLF | Line delimiter with DELIMITER = *LF | Line delimiter with DELIMITER = *NL |
---|---|---|---|
EBCDIC code (e.g. EDF041, EDF04F, UTFE) | 0D25 | 25 | 15 |
ASCII code, except UTF16 (e.g. ISO88591, ISO8859F, WCP1252, UTF8) | 0D0A | 0A | 0A |
UTF16 | 000D000A | 000A | 000A |
CHARACTER-CONVERSION = *TO-WIN-ANSI
The EBCDIC encoded input files are converted to WIN-ANSI before compression.
The logic of CHARACTER-CONVERSION =*TO-WIN-ANSI is identical to CHARACTER-CONVERSION =*BY-CONTAINER-FORMAT, except if DATA-TYPE = *BINARY conversion will be performed.
Files are converted only
- if the archive is opened in winzip compatible format
- if the original file has SAM/ISAM structure are converted
Standard conversion checks if the CODED-CHARACTER-SET is set to one of the values that BS2ZIP considers single byte EBCDIC encodings. They are listed in the table below. If it is one of them, then it performs a conversion from EDF04F to ISO8859F. Otherwise, no conversion is applied.
Standard conversion will be applied for: |
---|
EDF03IRV EDF03DRV EDF04DRV EDF041 EDF042 EDF043 EDF044 EDF045 EDF046 EDF047 EDF049 EDF04A EDF04B EDF04C EDF04D EDF04E EDF04F EEHCL2 EEHCLC EEHCLC1 EEHCLAA EEHCLG |
Files inside winzip compatible archives with DATA-TYPE specified to *NOT-SPECIFIED or *CHARACTER and file structure of SAM or ISAM will have a line delimiter based on the encoding to which the original file was converted to or the original file encoding, if no conversion was applied, as described in the table below.
Encoding of file in archive | Line delimiter with DELIMITER = *STD / *CRLF | Line delimiter with DELIMITER = *LF | Line delimiter with DELIMITER = *NL |
---|---|---|---|
EBCDIC code (e.g. EDF041, EDF04F, UTFE) | 0D25 | 25 | 15 |
ASCII code, except UTF16 (e.g. ISO88591, ISO8859F, WCP1252, UTF8) | 0D0A | 0A | 0A |
UTF16 | 000D000A | 000A | 000A |
COMPRESSION-LEVEL =
This operand determines the compression level. It allows adjusting the speed/compression size ratio. This operand is inapplicable to empty filee as they are stored without compression and they only require to store their metadata.
COMPRESSION-LEVEL = *STD
This compression mode selects a compromise between the speed and the compression size.
COMPRESSION-LEVEL = *BEST-SPEED
This compression mode selects the fastest compression. Such a mode results in a larger container.
COMPRESSION-LEVEL = *BEST-COMPRESSION
This compression mode selects the best compression. Such a mode results in a smaller container but requires larger processing time.
COMPRESSION-LEVEL = *NONE
The file is added without compression.
DATA-TYPE =
The DATA-TYPE operand controls the usage and line delimiter type for text files. This option is only relevant for SAM files to be added to a winzip compatible container. The default value *NOT-SPECIFIED currently corresponds to *CHARACTER.
DATA-TYPE | Container format WINZIP compatible | Container format BS2000 |
*NOT-SPECIFIED / *CHARACTER |
|
|
*BINARY |
| Not relevant. |
EXCEPT-FILE-NAME =
Serves to specify files that are to be excluded from zipping.
EXCEPT-FILE-NAME = *NONE
All files specified with the FROM-FILE operand are to be archived.
EXCEPT-FILE-NAME = *FROM-FILE(...)
The path names of the files to be excluded from zipping are to be taken from a file. The nonprivileged caller must be owner or co-owner of this file. This list file must be a SAM file with variable-length records containing one path name per record. Lower-case characters may be used, but they will be assimilated to upper-case characters. File names must be fully qualified with or without catid or userid.
The list file can be created, for instance, by means of the DMS command SHOW-FILE-ATTRIBUTES.
LIST-FILE-NAME = <filename 1..54 without-gen-vers>
Path name of the list file.
EXCEPT-FILE-NAME = *FROM-LIBRARY-ELEMENT(...)
The path names of the files which are not to be zipped are taken from a PLAM library element (type S). The library element consists of records of variable length and contains one path name per record. Lower-case characters may be used, but they will be assimilated to upper-case characters. File names must be fully qualified with or without catid or userid.
LIBRARY = <filename 1..54 without-gen-vers>
Name of the PLAM library.
ELEMENT = <composed-name 1..64 with-under>
Name of the type-S element containing the list file. The element of the highest existing version is used.
EXCEPT-FILE-NAME = list-poss(20): <filename 1..54 without-vers with-wild(80)>
The path names of the files to be excluded from archival are specified directly. A list of up to 20 names may be specified.
The first character of the file names must not be a hyphen. The file names may be specified as fully or partially qualified names, with or without a catalog/user ID. If required, the file name is extended by the user ID of the request and the default catalog ID.
You can also use wildcard syntax to select the files.
DELETE-SOURCE = *NO / *YES
Specifies whether the original files/library elements are to be deleted after they have been added to the ZIP archive. The default *NO retains the original files/library elements .
DELETE-SOURCE = *YES
The original files/library elements are deleted. A message is issued if deletion is not possible because of the protection attributes.
- If the source file is protected against writing, the file is added in the ZIP container and an error message is sent to the user.
- If the source library element is protected against writing, the library element is added in the zip container and an error message is sent to the user.
- If the source library is protected against writing, the library element is added in the zip container and an error message is sent to the user.
DELIMITER = *STD / *CRLF / *LF / *NL
Controls the line delimiter for text files added to winzip compatible archive. This operand is ignored if:
- The archive is in BS2000 format
- DATA-TYPE=*BINARY
- FCBTYPE of the original file is PAM
The operand DELIMITER will pick the line delimiter based on CCSNAME of the encoding in which the file is stored inside of the archive.
DELIMITER operand value | ASCII (except UTF16) | EBCDIC | UTF16 |
*STD or *CRLF | 0D0A | 0D25 | 000D000A |
*LF | 0A | 25 | 000A |
*NL | 0A | 15 | 000A |
LOGGING = *MINIMUM / *MAXIMUM
Controls the amount of the message output.
LOGGING = *MINIMUM
Only error messages will be sent.
LOGGING =*MAXIMUM
All messages will be sent. Currently the [guaranteed] messages SZP0116 and SZP0117 are sent after resp. file addition and library element addition; further messages may be added in the future.
Notes
Compression figures:
Compression mode
Size after compression
(280630 PP uncompressed)Compression ratio
CPU time
*BEST-SPEED
54096 PP
80,7 %
448,5 sec.
*STD
44496 PP
84,2 %
970,2 sec.
*BEST-COMPRESSION
43488 PP
84,5 %
8229,6 sec.
If the K2 key is pressed during the ADD-FILE statement, processing is interrupted with the query message
SZP0208
:
The user can simply continue processing.
The user can terminate processing and return to statement mode (//). The files which had not been added by the time the interruption occurred are not added. If required, they must be added again.
Using the default TO-FILE=*BY-SOURCE file names are always registered in the ZIP container without catid/userid. To register catid/userid, they have to be specified in the TO-FILE operand.
Specification in ADD-FILE
Registered as
FROM-FILE = MYFILE
MYFILE
FROM-FILE = $UID.MYFILE
MYFILE
FROM-FILE = :CAT1:$UID.MYFILE
MYFILE
FROM-FILE = MYFILE, TO-FILE=$UID.MYFILE
$UID.MYFILE
FROM-FILE = MY*,TO-FILE=NEW-*
NEW-FILE
FROM-FILE = #MYFILE.1
S.163.TSN1.MYFILE.1
FROM-FILE = #MYFILE.1,TO-FILE=MYFILE
MYFILE
FROM-FILE = #MYFILE.*,TO-FILE=MYFILE-*
MYFILE-1
If data encryption had been set using the MODIFY-ZIP-OPTIONS statement, the files are encrypted when they are added. The standard Zip 2.0 encryption used here is compatible with WinZip on Windows-based systems.