Skip to content

ZosDataSet

The ZosDataSet object represents a data set in the server. This object can be obtained using the GetDataSet method of ZosServer or the GetDataSets method of ZosDataSetFolder.

ZosDataSet Properties

ZosDataSet exposes the following properties:

Property Type R/W Description
Name String R Data set name.
Path String R Full path name of the data set.
DataSetType ZosDataSetType R Data set type (organization)
RecordFormat ZosRecordFormat R Record format
RecordLength Int16 R Logical record length
BlockSize Int16 R Block size
DataClass String R Data class
StorageClass String R Storage class
ManagementClass String R Management class
ExtendedAttributes ZosDataSetEAttr R Extended attributes: Default, No, Opt
UnitName String R Unit name
Volume String R Volume serial number
SpaceUnit ZosSpaceUnit R Space unit type
PrimarySpace Int32 R Primary space allocation
SecondarySpace Int32 R Secondary space allocation
Extents Int32 R Number of extents allocated
AllocatedTracks Int32 R Number of tracks allocated
UsedTracks Int32 R Number of tracks used
UsedPercent Int16 R Percent of space used
DirectoryBlocks Int32 R Number of directory blocks
UsedDirectoryBlocks Int32 R Number of directory blocks used
Members Int32 R Number of members
CreationDate DateTime R Creation date
LastAccessDate DateTime R Last access date
PdseVersion Int16 R PDSE version number: 0 (default), 1, 2
MaxGens Int32 R Maximum number of PDSE member generations
Encrypted Boolean R Indicates data set is encrypted
JobName String R Job name used to create data set (extended attribute)
StepName String R Step name used to create data set (extended attribute)

...

ZosDataSet Methods

ZosDataSet exposes the following methods:

CompressPds Method

Compresses a partitioned data set.

void  CompressPds()

CopyTo Method

Copy this data set to another data set. For partitioned data sets, you can copy the full data set or selected members. Member names can be specified using wild characters.

Overloads

CopyTo(ZosDataSet)

void CopyTo (  ZosDataSet dataset  )

...

CopyTo(ZosDataSet, String)

void CopyTo(
        ZosDataSet dataset,     
        String member  
        ) 

...

CopyTo(ZosDataSet, String[])

void CopyTo(
        ZosDataSet dataset,  
        String[] members  
        )         

...

Create Method

Create a new data set on the server. The data set attributes are specified using a ZosDataSetInfo object. Returns a data set object representing the new data set.

Static ZosDataSet  Create(
          ZosServer server,  
          String dsname,  
          ZosDataSetInfo info  
          )

Delete Method

Deletes the data set.

void  Delete()

GetInfo Method

Gets a data set information object containing the data set information. This object can be used to create a new data set modeled after this data set.

ZosDataSetInfo GetInfo() 

GetMember Method

Gets a single member of a partitioned data set by member name.

ZosPdsMember GetMember( String name )

GetMembers Method

Gets an array of members that belong to a partitioned data set. The list can optionally be filtered.

Overloads

GetMembers()

GetMembers()

...

GetMembers(String)

ZosPdsMember[]  GetMembers(
        String nameFilter 
        )

...

GetMembers(DateTime)

ZosPdsMember[]  GetMembers(
        DateTime changeTime 
        ) 

...

GetMembers( String, DateTime)

ZosPdsMember[]  GetMembers(
        String nameFilter,  
        DateTime changeTime
        ) 

...

Parameters

nameFilter - Componenent name filter (pattern)

changeTime - get members changed after the specified time.

...

InitializePds Method

Resets a partitioned data set to empty (deletes all members).

void  InitializePds() 

Migrate Method

HSM migrates a data set.

void  Migrate()

Recall Method

HSM recalls a data set.

void  Recall()

RecordFormatToString Method

Formats a ZosRecordFormat enumeration into a display string.

static String\^  RecordFormatToString(  
          ZosRecordFormat recfm  
          )

...

Refresh Method

Refreshes the data set information.

void  Refresh()

Rename Method

Renames the data set.

void  Rename(  
            String newName  ) 

StringToRecordFormat Method

Converts a character string representation of a record format to a ZosRecordFormat enumeration.

static ZosRecordFormat  StringToRecordFormat(
          String\^ text  
          )

...

ZosDataSet Examples

Examples of using ZosDataSet are shown below:

C

ZosDataSet dataset;
ZosDataSet dataset2;
ZosRecordFormat recfmt;
String text;
recfmt = ZodDataSet.StringToRecordFormat(“FB”);
text = ZosDataSet.RecordFormatToString(recfm);
ZosPdsMember member = dataset.GetMember(“JUNK”);
ZosPdsMembers members = dataset.GetMembers(“X*”);
ZosDataSetInfo info = dataset.GetInfo();
info.DataSetType = ZosDataSetType.Pdse;
dataset2 = ZosDataSet.Create(server, “NEW.DATA.SET”, info);

...

C++

ZosDataSet^ dataset;
ZosDataSet^ dataset2;
ZosRecordFormat recfmt;
String^ text;
recfmt = ZodDataSet::StringToRecordFormat(“FB”);
text = ZosDataSet::RecordFormatToString(recfm);
ZosPdsMember^ member = dataset.GetMember(“JUNK”);
array<ZosPdsMember^>^ members = dataset.GetMembers(“X*”);
ZosDataSetInfo^ info = dataset.GetInfo();
info.DataSetType = ZosDataSetType::Pdse;
dataset2 = ZosDataSet::Create(server, “NEW.DATA.SET”, info);

...

Visual Basic

Dim dataset As ZosDataSet
Dim dataset2 As ZosDataSet
Dim recmt As ZosRecordFormat
Dim text As String
recfmt = ZodDataSet.StringToRecordFormat(“FB”)
text = ZosDataSet.RecordFormatToString(recfm)
Dim member As ZosPdsMember = dataset.GetMember(“JUNK”)
Dim members() As ZosPdsMember = dataset.GetMembers(“X*”)
Dim info As ZosDataSetInfo = dataset.GetInfo()
info.DataSetType = ZosDataSetType.Pdse
dataset2 = ZosDataSet.Create(server, “NEW.DATA.SET”, info)

...

Jscript

var dataset : ZosDataSet;
var dataset2 : ZosDataSet;
var recmt : ZosRecordFormat;
var text : String;
recfmt = ZodDataSet.StringToRecordFormat(“FB”);
text = ZosDataSet.RecordFormatToString(recfm);
var member : ZosPdsMember = dataset.GetMember(“JUNK”);
var members : ZosPdsMembers[] = dataset.GetMembers(“X*”);
var info : ZosDatSetInfo = dataset.GetInfo();
info.DataSetType = ZosDataSetType.Pdse;
dataset2 = ZosDataSet.Create(server, “NEW.DATA.SET”, info);

...

Back to top