Skip to content

ZosFileFormatMappings

The ZosFileFormatMappings object is a collection of file format mappings for a server or a ChangeMan instance. This object is obtained using the DataSetFileFormats property or the UnixFileFormats property of the ZosServer object. For ChangeMan instances, it can be obtained using the FileFormats property of the ZosChangeManFolder object.

ZosFileFormatMappings Properties

ZosFileFormatMappings exposes the following properties:

Property Type R/W Description
[index] [name] ZosFileFormatMapping R File format 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

ZosFileFormatMappings Methods

ZosFileFormatMappings exposes the following methods:

Add Method

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

Overloads

Add(Int32, ZosFileFormatMapping)

Int32 Add( Int32 index, ZosFileFormatMapping mapping )

Add(Int32, String, ZosFileFormat)

Int32 Add( Int32 index, String name, ZosFileFormat format )

Find Method

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

ZosFileFormatMapping 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 onedimensional array into the collection. The existing contents of the collection are completely replaced.

void FromArray( ZosFileFormatMapping[] array )

Move Method

Changes the order of file format mappings.

Int32 Move( Int32 indexTo, Int32 indexFrom )

Refresh Method

Refreshes collection.

void Refresh()

Remove Method

Deletes a file format 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 file format mapping, specified by index.

void RemoveAt( Int32 index )

ToArray Method

Copies the entire collection to a onedimensional array.

ZosFileFormatMapping[] ToArray()

ZosFileFormatMappings Examples

Examples of using ZosFileFormatMappings are shown below:

C

ZosFileFormatMappings formats;
ZosFileFormatMapping[] formatArray =
    new ZosFileFormatMapping[]
{
    new ZosFileFormatMapping("**.ETEXT", ZosFileFormat.EbcdicText),
    new ZosFileFormatMapping("**.ATEXT", ZosFileFormat.AsciiText)
};
formats.FromArray(formatArray);
formats.Add(–1, “**.BINARY”, ZosFileFormat::Binary);
formats.Remove(“**.TRASH”);
formats.Move(4,2);

...

C++

ZosFileFormatMappings^ formats;
array<ZosFileFormatMapping>^ formatArray =
{
    new ZosFileFormatMapping("**.ETEXT", ZosFileFormat.EbcdicText),
    new ZosFileFormatMapping("**.ATEXT", ZosFileFormat.AsciiText)
};
formats.FromArray(formatArray);
formats->Add(–1, “**.BINARY”, ZosFileFormat::Binary);
formats->Remove(“**.TRASH”);
formats->Move(4,2);

...

Visual Basic

Dim formats As ZosFileFormatMappings
Dim formatArray() As ZosFileFormatMapping = _
{ _
New ZosFileFormatMapping("**.ETEXT", ZosFileFormat.EbcdicText), _
New ZosFileFormatMapping("**.ATEXT", ZosFileFormat.AsciiText) _
}file format mapping
formats.FromArray(formatArray)
formats.Add(–1, “**.BINARY”, ZosFileFormat::Binary)
formats.Remove(“**.TRASH”)
formats.Move(4,2)

...

Jscript

var formats : ZosFileFormatMappings;
var formatArray : ZosFileFormatMapping[] =
[
    new ZosFileFormatMapping("**.ETEXT", ZosFileFormat.EbcdicText),
    new ZosFileFormatMapping("**.ATEXT", ZosFileFormat.AsciiText)
];
formats.FromArray(formatArray);
formats.Add(–1, “**.BINARY”, ZosFileFormat::Binary);
formats.Remove(“**.TRASH”);
formats.Move(4,2);

...

Back to top