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.
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 = <filename 1..54 without-vers with-wild(80)>
The specified file is added to the ZIP file. When wildcards are used, all the supported files matching the pattern 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 number.
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.
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 = <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 transfered 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-FILES = *BY-SOURCE is accepted or a value without wildcards, but eventually terminated by a period character (partial qualifier). In this case, the TO-FILES 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-FILES = *BY-SOURCE is accepted or a value without wildcards, but eventually terminated by a period character. In this case, the TO-FILES 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:
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.
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).
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.
CHARACTER-CONVERSION = *BY-CONTAINER-FORMAT
The input files are converted according to the format of the ZIP file.
CHARACTER-CONVERSION = *NO
The input files are not converted.
CHARACTER-CONVERSION = *TO-EBCDIC
The ASCII encoded input files are converted to EBCDIC before compression.
Only SAM/ISAM files are converted.
CHARACTER-CONVERSION = *TO-WIN-ANSI
The EBCDIC encoded input files are converted to WIN-ANSI before compression.
Only SAM/ISAM files are converted.
COMPRESSION-LEVEL =
This operand determines the compression level. It allows adjusting the speed/compression size ratio.
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 larger container.
COMPRESSION-LEVEL = *BEST-COMPRESSION
This compression mode selects the best compression. Such a mode results smaller container but requires larger processing time.
COMPRESSION-LEVEL = *NONE
The file is added without compression.
DATA-TYPE =
The DATA-TYPE operand controls the file inclusion. 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 members are to be deleted after they have been added to the ZIP archive. The default *NO retains the original files/library members.
DELETE-SOURCE = *YES
The original files/library members 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.
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.
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..