Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
JRIO_READ_WRITE_MODE Data set characteristics JRIO_DEFAULT_RECORD_FORMAT: Fixed block record. JRIO_DEFAULT_RECORD_LENGTH: Default record length of 80. JRIO_VARIABLE_MODE JRIO_FIXED_MODE JRIO_DEFAULT_DSP_TYPE: Same as JRIO_DSP_TYPE_OLD. JRIO_DSP_TYPE_OLD JRIO_DSP_TYPE_SHR JRIO_DEFAULT_ALLOC_TYPE: Same as JRIO_BLOCK_ALLOC_TYPE. JRIO_BLOCK_ALLOC_TYPE JRIO_CYL_ALLOC_TYPE JRIO_TRACK_ALLOC_TYPE The classes and interfaces provided for accessing records using keys are described in 3.2, "Working with VSAM data sets" on page 41. 3.1.2 JRIO usage examples In this section we present a number of examples using JRIO. Copying members of a data set The following Java program demonstrates the use of the JRIO library. The program takes an existing data set name, creates a new data set with the same characteristics, and copies all members of the specified data set into the new data set. This example demonstrates how to use IDirectory and IRecordFile to represent a data set and members in the data set respectively. Using the instances of IDirectory and IRecordFile, we also demonstrate how to discover all the members in a data set, create new members in a data set with the same characteristics, and copy all members into the new data set. We use IFileInputRecordStream and IFileOutputRecordStream to read records from a member and write the records to a new member. The program can be invoked as follows: java DirCopy USER1.DATA The first argument to the program specifies the data set name whose members are copied to a new data set. The new data set is created with the name USER1.DATA.COPY. When the program executes successfully, it prints the Chapter 3. Access to MVS data sets 35