Obtaining the characteristics of a data set

To obtain the characteristics of a data set of any type:

IDataSet dataSet = ...

try {
    // fetch the characteristics from the dataset
    IDataSetCharacteristics dataSetCharacteristics = dataSet
            .fetchCharacteristics();

    ...
} catch (DataSetAccessException e) {
    // the user does not have access to this dataset
    ...
} catch (DataSetInUseException e) {
    // the dataset is enqueued by another user or job
    ...
} catch (DataSetMigratedException e) {
    // the dataset has been migrated since it was first retrieved
    ...
} catch (DataSetNotFoundException e) {
    // the dataset can no longer be found
    ...
}

To obtain the characteristics of a partitioned data set:

IPartitionedDataSet dataSet = ...

try {
    // fetch the partitioned dataset characteristics from the
    // partitioned dataset
    IPartitionedDataSetCharacteristics partitionedDataSetCharacteristics = partitionedDataSet
            .fetchCharacteristics();

    ...
} catch (DataSetAccessException e) {
    // the user does not have access to this dataset
    ...
} catch (DataSetInUseException e) {
    // the dataset is enqueued by another user or job
    ...
} catch (DataSetMigratedException e) {
    // the dataset has been migrated since it was first retrieved
    ...
} catch (DataSetNotFoundException e) {
    // the dataset can no longer be found
    ...
}

To obtain the characteristics of a sequential data set:

ISequentialDataSet sequentialDataSet = ...

try {
    // fetch the sequential dataset characteristics from the sequential
    // dataset
    ISequentialDataSetCharacteristics sequentialDataSetCharacteristics = sequentialDataSet
            .fetchCharacteristics();

    ...
} catch (DataSetAccessException e) {
    // the user does not have access to this dataset
    ...
} catch (DataSetInUseException e) {
    // the dataset is enqueued by another user or job
    ...
} catch (DataSetMigratedException e) {
    // the dataset has been migrated since it was first retrieved
    ...
} catch (DataSetNotFoundException e) {
    // the dataset can no longer be found
    ...
}

To obtain the characteristics of a VSAM cluster:

IVSAMCluster vsamCluster = ...

try {
    // fetch the VSAM cluster characteristics from the VSAM cluster
    IVSAMClusterCharacteristics vsamClusterCharacteristics = vsamCluster
            .fetchCharacteristics();

    ...
} catch (DataSetAccessException e) {
    // the user does not have access to this VSAM cluster
    ...
} catch (DataSetInUseException e) {
    // the VSAM cluster is enqueued by another user or job
    ...
} catch (DataSetMigratedException e) {
    // the VSAM cluster has been migrated since it was first retrieved
    ...
} catch (DataSetNotFoundException e) {
    // the VSAM cluster can no longer be found
    ...
}
Was this page helpful? Yes No Submitting... Thank you

Comments