Class ZipDatasets
java.lang.Object
com.ibm.jzos.sample.ZipDatasets
A sample Java main class that can be invoked to create a Zip archive from one
or more datasets or PDS members. Datasets are treated as text and converted
from EBCDIC to ASCII (ISO8859-1) or to the specified target codepage.
Details on the input arguments to this class are available by executing
the main method with no arguments. (see usage())
Example: Zip several partitioned datasets to a Unix zip file:
com.ibm.jzos.sample.ZipDatasets test.zip sys1.proclib(asm*) hlq.**.jcl
Example: Zip all datasets matching two patterns to a dataset:
com.ibm.jzos.sample.ZipDatasets //hlq.backup.zip payroll.*.data gl.**.dat*
Example: Zip data using DDs and input and output:
com.ibm.jzos.sample.ZipDatasets //DD:ZIPOUT //DD:INSEQ1 //DD:INPDS1 //DD:INPDS2(FOO*)
- Since:
- 2.3.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidA Java main method for invoking this class.intrun()Process the given input datasets and create a Zip archive on the given output file or dataset.voidsetTargetEncoding(String targetEncoding) Sets the name of the codepage used to encode the text data written to the Zip file.static voidusage()Display usage syntax for invoking this class as a java main() method.
-
Field Details
-
DEFAULT_TARGET_ENCODING
- See Also:
-
-
Constructor Details
-
ZipDatasets
-
-
Method Details
-
usage
public static void usage()Display usage syntax for invoking this class as a java main() method. -
main
-
setTargetEncoding
Sets the name of the codepage used to encode the text data written to the Zip file. If not called, defaults toDEFAULT_TARGET_ENCODING.- Parameters:
targetEncoding-
-
run
Process the given input datasets and create a Zip archive on the given output file or dataset.- Throws:
IOException
-