Skip to content

ZosLibTypeMappings

The ZosLibTypeMappings object is a collection of all library type mappings for a server. This object is obtained using the LibTypes property of the ZosServer object. Library types only need to be defined if you are using Librarian or Panvalet libraries.

ZosLibTypeMappings Properties

ZosLibTypeMappings exposes the following properties:

Property Type R/W Description
[index] [name] ZosLibTypeMapping R Library type mapping with specified index or data set name pattern.
Count Int32 R Number of objects in collection.
Path String R File system path name for collection.

ZosLibTypeMappings Methods

ZosLibTypeMappings exposes the following methods:

Add Method

Adds a new library type mapping.

Overloads

Add(Int32, ZosLibTypeMapping)

Adds a new library type mapping. Index indicates position for new item. Specify –1 to insert at end. Returns index at which object has been added.

Int32  Add(  
        Int32 index,  
        ZosLibTypeMapping mapping  
        ) 

...

Add( Int32, String, ZosLibType)

Adds a new library type mapping. Index indicates position for new item. Specify –1 to insert at end. Returns index at which object has been added.

Int32  Add(  
        Int32 index,  
        String dsName,  
        ZosLibType libType  
        ) 

...

Find Method

Searches for mapping with specified name and returns reference to object. Returns null if name is not found.

ZosLibTypeMapping  Find(  
        String name  
        ) 

FindIndex Method

Searches for mapping with specified name and returns zero-based index. Returns -1 if name is not found.

Int32  FindIndex(  
        String name  
        ) 

FromArray Method

Copies the contents of a one- dimensional array into the collection. The existing contents of the collection are completely replaced.

void FromArray( ZosLibTypeMapping[] array )

Move Method

Changes the order of library type mappings.

Int32  Move(  
        Int32 indexTo,  
        Int32 indexFrom  
        ) 

Refresh Method

Refreshes collection.

void Refresh()

Remove Method

Deletes a library type mapping, specified by data set name pattern. Returns true if item was removed or false if item is not found.

Boolean  Remove(  
        String name  
        )

RemoveAt Method

Deletes a library type mapping, specified by index.

void  RemoveAt(  
        Int32 index  
        )

ToArray Method

Copies the entire collection to a onedimensional array.

ZosLibTypeMapping[] ToArray()

ZosLibTypeMappings Examples

Examples of using ZosLibTypeMappings are shown below:

C

ZosLibTypeMappings libTypes;
ZosLibTypeMapping[] libTypeArray = new ZosLibTypeMapping[]
{
new ZosLibTypeMapping("**.LIBRARY", ZosLibType.Lib),
new ZosLibTypeMapping("**.PANVALET", ZosLibType.Pan)
};
libTypes.FromArray(libTypeArray);
libTypes.Add(–1, “**.PANVALET”, ZosLibType::Pan);
libTypes.Remove(“**.LIBRARY”);
libTypes.Move(4,2);

...

C++

ZosLibTypeMappings^ libTypes;
array<ZosLibTypeMapping>^ libTypeArray =
{
new ZosLibTypeMapping("**.LIBRARY", ZosLibType.Lib),
new ZosLibTypeMapping("**.PANVALET", ZosLibType.Pan)
};
libTypes.FromArray(libTypeArray);
libTypes->Add(–1, “**.PANVALET”, ZosLibType::Pan);
libTypes->Remove(“**.LIBRARY”);
libTypes->Move(4,2);

...

Visual Basic

Dim libTypes As ZosLibTypeMappings
Dim libTypeArray() As ZosLibTypeMapping = _
{ _
New ZosLibTypeMapping("**.LIBRARY", ZosLibType.Lib), _
New ZosLibTypeMapping("**.PANVALET", ZosLibType.Pan) _
} libTypes.FromArray(libTypeArray)
libTypes.Add(–1, “**.PANVALET”, ZosLibType::Pan)
libTypes.Remove(“**.LIBRARY”)
libTypes.Move(4,2)

...

Jscript

var libTypes : ZosLibTypeMappings;
var libTypeArray : ZosLibTypeMapping[] =
[
new ZosLibTypeMapping("**.LIBRARY", ZosLibType.Lib),
new ZosLibTypeMapping("**.PANVALET", ZosLibType.Pan)
];
libTypes.FromArray(libTypeArray);
libTypes.Add(–1, “**.PANVALET”, ZosLibType::Pan);
libTypes.Remove(“**.LIBRARY”);
libTypes.Move(4,2);

...

Back to top