Sample Java programs for the IBM JZOS toolkit:
A summary of sample programs (all in package com.ibm.jzos.sample) follows:
Sample program that uses BPXWDYN to dynamically allocate a new dataset with the same attributes as a given dataset, and then copy the original to the new dataset. The name of the source dataset and target dataset names are given as arguments.
Sample program that uses the FileFactory class to copy a text file or dataset. The input and output file names are given as arguments to main, and they may be either POSIX (HFS) file names or MVS dataset names.
Simple class that says hello on System.out and System.err.
Sample program that lists a PDS directory.
Sample program that dumps 500 bytes from the CVT to System.out.
Simple class used to display Java system properties and selected system environment variables.
Sample program that uses the ZFile class to copy an MVS dataset in record mode from DD INPUT to DD OUTPUT.
Sample program that inserts, updates, locates, and deletes records in a VSAM KSDS using a JZOS ZFile.
Sample program that prints an EBCDIC MVS dataset pointed to by //INPUT DD to System.out (stdout).
This sample shows how JZOS can be used to interact with the MVS console.
This sample demonstrates a main program that can be used to wrap another main program while redirecting System.in and System.out to the MVS console.
Sample program that uses CatalogSearch, LOCATE and OBTAIN to display information about datasets matching a filter key.
Sample program which reads all sysout data for a MvsJob (jobname and jobid), and writes the output to a specified Writer.
Sample program which submits a job to the internal reader, returning a MvsJob object containing the jobname and jobid.
Sample classes which use the com.ibm.jzos.fields converter classes to map a z/OS format 5 DSCB into a java record.
Sample classes which use the com.ibm.jzos.fields converter classes to map some components of an Smf83 record.
Demonstrates how to delete a directory. It may be either a HFS directory or a PDS directory.
Demonstrates how to list the contents of a directory in two different ways. One approach lists all of the objects in the directory and the other approach lists only the sub-directories.
Demonstrates how to create a new directory with default attribute values.
Demonstrates how to create a directory using the attributes of an existing directory.
Demonstrates how to copy data from one file to another, appending to the second file if it already exists.
Demonstrates how to create a file with default attributes values.
Uses BPXWDYN to dynamically allocate a new dataset with the same attributes as a given dataset.
Demonstrates how to create a non-VSAM MVS dataset with specific file attributes.
Demonstrates how to delete a file.
Demonstrates how to retrieve file attributes.
Demonstrates how to randomly access a file.
Demonstrates how to read a file sequentially.
Demonstrates how to rename a file.
Demonstrates how to write data to a file sequentially.
Demonstrates how to create a VSAM alternate index.
Demonstrates how to create a VSAM cluster.
Demonstrates how to delete a VSAM alternate index created by DefineKsdsAIX.
Demonstrates how to delete a VSAM KSDS cluster created by DefineKsdsCluster.
Demonstrates how to delete records from a VSAM dataset.
Demonstrates how to read records from a VSAM dataset.
Demonstrates how to write records to a VSAM dataset.
Demonstrates how to update records in a VSAM dataset.