public class ZipDatasets
extends java.lang.Object
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*)
ZFile
,
ZUtil
,
CatalogSearch
,
java.util.zip.ZipOutputStream
,
java.util.regex.Pattern
,
java.util.regex.Matcher
,
ZipDatasetSource (the class which creates Zip archive entries for each input dataset/pattern)
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_TARGET_ENCODING |
Constructor and Description |
---|
ZipDatasets(java.lang.String outFileName,
java.lang.String[] indsnames)
Construct an instance
|
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
A Java main method for invoking this class.
|
int |
run()
Process the given input datasets and create a Zip archive on the
given output file or dataset.
|
void |
setTargetEncoding(java.lang.String targetEncoding)
Sets the name of the codepage used to encode the text data written
to the Zip file.
|
static void |
usage()
Display usage syntax for invoking this class as a java main() method.
|
public static final java.lang.String DEFAULT_TARGET_ENCODING
public ZipDatasets(java.lang.String outFileName, java.lang.String[] indsnames)
outFileName
- the name of the /output/file, //DATASET, //DD:name, etc
where the Zip archive is written.indsnames
- an array of input dataset names / patternsfor more details on allowed input dataset names
public static void usage()
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- java.lang.Exception
usage()
public void setTargetEncoding(java.lang.String targetEncoding)
DEFAULT_TARGET_ENCODING
.targetEncoding
- public int run() throws java.io.IOException
java.io.IOException