Class CopyDataset


  • public class CopyDataset
    extends ZosConnection
    Class example to showcase CopyDataset functionality.
    Version:
    1.0
    Author:
    Leonid Baranov
    • Constructor Detail

      • CopyDataset

        public CopyDataset()
    • Method Detail

      • main

        public static void main​(String[] args)
                         throws Exception
        Main method defines z/OSMF host and user connection and other parameters needed to showcase CopyDataset functionality. Calls CopyDataset example methods.
        Parameters:
        args - for main not used
        Throws:
        Exception - error processing examples
      • copyDataset

        public static void copyDataset​(ZOSConnection connection,
                                       String fromDataSetName,
                                       String toDataSetName)
                                throws Exception
        Example on how to call ZosDsnCopy copy method. Copy method accepts a from and too strings for copying.

        This copy method allows the following copy operations:

        - sequential dataset to sequential dataset - sequential dataset to partition dataset member - partition dataset member to partition dataset member - partition dataset member to partition dataset non-existing member - partition dataset member to sequential dataset

        This example sends false value for copyAllMembers parameter in copy method to indicate we are not copying all members in a partition dataset to another.

        Parameters:
        connection - ZOSConnection
        fromDataSetName - source dataset (e.g. 'SOURCE.DATASET' or 'SOURCE.DATASET(MEMBER)')
        toDataSetName - destination dataset (e.g. 'TARGET.DATASET' or 'TARGET.DATASET(MEMBER)')
        Throws:
        Exception - error processing copy request
      • copyDatasetByCopyParams

        public static void copyDatasetByCopyParams​(ZOSConnection connection,
                                                   String fromDataSetName,
                                                   String toDataSetName)
                                            throws Exception
        Example on how to call ZosDsnCopy copy method. Copy method accepts a CopyParams object.

        This copy method allows the following copy operations:

        - sequential dataset to sequential dataset - sequential dataset to partition dataset member - partition dataset member to partition dataset member - partition dataset member to partition dataset non-existing member - partition dataset member to sequential dataset

        Parameters:
        connection - ZOSConnection
        fromDataSetName - source dataset (e.g. 'SOURCE.DATASET' or 'SOURCE.DATASET(MEMBER)')
        toDataSetName - destination dataset (e.g. 'TARGET.DATASET' or 'TARGET.DATASET(MEMBER)')
        Throws:
        Exception - error processing copy request
      • copyFullPartitionDatasetByCopyParams

        public static void copyFullPartitionDatasetByCopyParams​(ZOSConnection connection,
                                                                String fromDataSetName,
                                                                String toDataSetName)
                                                         throws Exception
        Example on how to call ZosDsnCopy copy method. Copy method accepts a CopyParams object.

        This copy method is different from the other two examples above as it sets the copyAllMember variable true to indicate that the copy operation will be performed on a partition dataset to another partition dataset copying all its members to the target.

        Parameters:
        connection - ZOSConnection
        fromDataSetName - source dataset (e.g. 'SOURCE.PARTITION.DATASET')
        toDataSetName - destination dataset (e.g. 'TARGET.PARTITION.DATASET')
        Throws:
        Exception - error processing copy request