Skip to content

Configuring ChangeMan ZDD for a New User

To simplify the setup of ChangeMan ZDD for multiple desktops, you can write a script to automate many of the configuration tasks. Then, a new user can configure ChangeMan ZDD for their own desktop simply by executing the script.

The following scripts illustrate how the configuration tasks can be performed.

C# Example

...

/**********************************************************************
* C# Example 
* 
* File Name: NewConfig.cs
*
* Description: Sample for creating a new configuration.
*
* Usage: NewConfig <userid>
*
* Copyright ©2003-2011, Serena Software. Licensed material. All rights reserved.
**********************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using ZosApi;

namespace NewConfig
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                //////////////////////////////
                // Get command line arguments
                //////////////////////////////

                if (args.Length < 1)
                {
                    Console.WriteLine("Usage: NewConfig <userid>");
                    Environment.Exit(1);
                }
                String userID = args[0];

                /////////////////////////////
                // Update network properties
                /////////////////////////////

                ZosNetwork network = new ZosNetwork();

                network.CacheFolder = "C:\\Temp";
                network.CacheDays = 3;
                network.NotifyPort = 8000;
                network.NotifyJobStep = true;
                network.NotifyMessageBox = true;

                ///////////////////////
                // Add the new servers
                ///////////////////////

                ZosServers servers = network.Servers;

                servers.Add("Server1", "172.20.20.1", 5000, 1140, "Description1");
                servers.Add("Server2", "172.20.20.2", 5000, 1140, "Description2");
                servers.Add("Server3", "172.20.20.3", 5000, 1140, "Description3");

...

...

                /////////////////////////////////////////
                // Update the properties for each server
                /////////////////////////////////////////

                foreach (ZosServer server in servers)
                {
                    int index;

                    ////////////////////////////////////////
                    // Add the data set file format entries
                    ////////////////////////////////////////

                        ZosFileFormatMappings dsFileFormats =
                    server.DataSetFileFormatMappings;

                    dsFileFormats.Add(-1, "**.ASCII.TEXT", ZosFileFormat.AsciiText);
                    dsFileFormats.Add(-1, "**.ASCII.DATA", ZosFileFormat.AsciiData);
                    dsFileFormats.Add(-1, "**.UNICODE.TEXT",
                    ZosFileFormat.UnicodeText);
                                dsFileFormats.Add(-1, "**.EBCDIC.TEXT",
                    ZosFileFormat.EbcdicText);
                                dsFileFormats.Add(-1, "**.EBCDIC.DATA",
                    ZosFileFormat.EbcdicData);
                                dsFileFormats.Add(-1, "**.BINARY",
                    ZosFileFormat.BinaryCRLF);

                    ///////////////////////////////////////////////////////////////
                    // The following illustrates a faster way to do the same thing
                    ///////////////////////////////////////////////////////////////

                    ZosFileFormatMapping[] fileFormatArray = new
                    ZosFileFormatMapping[]
                                {
                                new ZosFileFormatMapping("**.ASCII.TEXT",
                    ZosFileFormat.AsciiText),
                                new ZosFileFormatMapping("**.ASCII.DATA",
                    ZosFileFormat.AsciiData),
                                new ZosFileFormatMapping("**.UNICODE.TEXT",
                    ZosFileFormat.UnicodeText),
                                new ZosFileFormatMapping("**.EBCDIC.TEXT",
                    ZosFileFormat.EbcdicText),
                                new ZosFileFormatMapping("**.EBCDIC.DATA",
                    ZosFileFormat.EbcdicData),
                                new ZosFileFormatMapping("**.BINARY",
                    ZosFileFormat.BinaryCRLF)
                    };

                    dsFileFormats.FromArray(fileFormatArray);

                    ////////////////////////////////////
                    // Add the Unix file format entries
                    ////////////////////////////////////

                    ZosFileFormatMappings uFileFormats =
                    server.UnixFileFormatMappings;

                    uFileFormats.Add(-1, "*.TEXT", ZosFileFormat.AsciiText);
                    uFileFormats.Add(-1, "*.UTEXT", ZosFileFormat.UnicodeText);
                    uFileFormats.Add(-1, "*.BIN", ZosFileFormat.Binary);

                    ////////////////////////////////
                    // Add the library type entries
                    ////////////////////////////////

                    ZosLibTypeMappings libTypes = server.LibTypeMappings;

                    libTypes.Add(-1, "**.LIBRARY", ZosLibType.Lib);
                    libTypes.Add(-1, "**.PANVALET", ZosLibType.Pan);

                    ///////////////////////////////////////////////////////////////
                    // The following illustrates a faster way to do the same thing
                    ///////////////////////////////////////////////////////////////

                    ZosLibTypeMapping[] libTypeArray = new ZosLibTypeMapping[]
                    {
                      new ZosLibTypeMapping("**.LIBRARY", ZosLibType.Lib),
                      new ZosLibTypeMapping("**.PANVALET", ZosLibType.Pan)
                    };
                    libTypes.FromArray(libTypeArray);

                    //////////////////////////////////
                    // Add the file extension entries
                    //////////////////////////////////

                    ZosFileExtensionMappings fileExtensions = server.FileExtensionMappings;

                    fileExtensions.Add(-1, "**.CNTL", "jcl");
                    fileExtensions.Add(-1, "**.COBOL", "cbl");
                    fileExtensions.Add(-1, "**.LIST", "txt");
                    fileExtensions.Add(-1, "**.WORD", "doc");
                    fileExtensions.Add(-1, "**.EXCEL", "xls");

                    ///////////////////////////////////////////////////////////////
                    // The following illustrates a faster way to do the same thing
                    ///////////////////////////////////////////////////////////////

                    ZosFileExtensionMapping[] fileExtArray = new ZosFileExtensionMapping[]
                    {
                    new ZosFileExtensionMapping("**.CNTL", "jcl"),
                    new ZosFileExtensionMapping("**.COBOL", "cbl"),
                    new ZosFileExtensionMapping("**.LIST", "txt"),
                    new ZosFileExtensionMapping("**.WORD", "doc"),
                    new ZosFileExtensionMapping("**.EXCEL", "xls")
                    };

                    fileExtensions.FromArray(fileExtArray);

                    //////////////////////////////////////
                    // Add the profiles for new data sets
                    //////////////////////////////////////                      

                    ZosDataSetProfiles dsProfiles = server.DataSetProfiles;

                    dsProfiles.Add(-1, "**.DATA", ZosDataSetType.Seq,
                    ZosRecordFormat.FB, 80, 0, "DATACLS1", "STORCLS1", "MGMTCLS1",
                    ZosSpaceUnit.Trk, 2, 1, 5, "SYSDA", "VOL001");
                                dsProfiles.Add(-1, "**.TEMP", ZosDataSetType.Seq,
                    ZosRecordFormat.FB, 80, 0, "DATACLS2", "STORCLS2", "MGMTCLS2",
                    ZosSpaceUnit.Cyl, 2, 1, 5, "SYSDA", "VOL002");
                                dsProfiles.Add(-1, "**.LIST", ZosDataSetType.Seq,
                    ZosRecordFormat.VB, 80, 0, "", "", "", ZosSpaceUnit.Blk,
                    500, 50, 5, "SYSDA", "");

                    ///////////////////////////////////////////////////////////////
                    // The following illustrates a faster way to do the same thing
                    ///////////////////////////////////////////////////////////////

                    ZosDataSetProfile[] dsProfileArray = new ZosDataSetProfile[]
                    {
                                    new ZosDataSetProfile("**.DATA", ZosDataSetType.Seq,
                    ZosRecordFormat.FB, 80, 0, "DATACLS1", "STORCLS1", "MGMTCLS1",
                    ZosSpaceUnit.Trk, 2, 1, 5, "SYSDA", "VOL001"),
                                    new ZosDataSetProfile("**.TEMP", ZosDataSetType.Seq,
                    ZosRecordFormat.FB, 80, 0, "DATACLS2", "STORCLS2", "MGMTCLS2",
                    ZosSpaceUnit.Cyl, 2, 1, 5, "SYSDA", "VOL002"),
                                    new ZosDataSetProfile("**.LIST", ZosDataSetType.Seq,
                    ZosRecordFormat.VB, 80, 0, "", "", "", ZosSpaceUnit.Blk,
                    500, 50, 5, "SYSDA", "")
                    };

                    dsProfiles.FromArray(dsProfileArray);

                    ////////////////////////
                    // Add data set folders
                    ////////////////////////

                    ZosDataSetFolders dsfolders = server.DataSetFolders;

                    ZosDataSetFolder dsfolder;
                    ZosNameFilters filters;
                    ZosPrefixMappings prefixes;

                    /////////////////////////////////////////////////
                    // "My DataSets" folder for all user's data sets
                    /////////////////////////////////////////////////

                    index = dsfolders.Add("My DataSets");
                    dsfolder = dsfolders[index];

                    filters = dsfolder.Filters;
                    prefixes = dsfolder.PrefixMappings;
                    filters.Add(userID + ".**");

                    prefixes.Add(-1, "**", userID);

                    //////////////////////////////////////////////////
                    // "My Source" folder for user's source libraries
                    //////////////////////////////////////////////////

                    index = dsfolders.Add("Source");
                    dsfolder = dsfolders[index];

                    filters = dsfolder.Filters;
                    prefixes = dsfolder.PrefixMappings;

                    filters.Add(userID + ".**.COBOL");
                    filters.Add(userID + ".**.ASM");

                    prefixes.Add(-1, "**.MOUSE", "MICKEY");
                    prefixes.Add(-1, "**", userID);

                    ///////////////////////////////////////////////////////////////
                    // The following illustrates a faster way to do the same thing
                    ///////////////////////////////////////////////////////////////

                    String[] filterArray = new String[]
                    {
                        userID + ".**.COBOL",
                        userID + ".**.ASM"
                    };

                    filters.FromArray(filterArray);

                    ZosPrefixMapping[] prefixArray = new ZosPrefixMapping[]
                    {
                        new ZosPrefixMapping("**.MOUSE", "MICKEY"),
                        new ZosPrefixMapping("**", userID)
                    };
                    prefixes.FromArray(prefixArray);

                    ///////////////////
                    // Add job folders
                    ///////////////////

                    ZosJobFolders jobfolders = server.JobFolders;

                    ZosJobFolder jobfolder;

                    ///////////////////////////////////////////
                    // "My Jobs" folder for jobs owned by user
                    ///////////////////////////////////////////

                    index = jobfolders.Add("My Jobs", ZosJobQueryType.QueueOwner, userID);
                    jobfolder = jobfolders[index];

                    ////////////////////////////////////////////////////////
                    // "ChangeMan" folder for job names prefixed with "CMN"
                    ////////////////////////////////////////////////////////

                    index = jobfolders.Add("ChangeMan", ZosJobQueryType.QueueJobname, 
                    "CMN*");

                    jobfolder = jobfolders[index];

                    ///////////////////////////////////////
                    // "Active" folder for all active jobs
                    ///////////////////////////////////////

                    index = jobfolders.Add("Active", ZosJobQueryType.ActiveAll);
                    jobfolder = jobfolders[index];

                    /////////////////////////
                    // Add ChangeMan instances
                    /////////////////////////

                    ZosChangeManInstances instances = server.ChangeManInstances;

                    instances.Add("ChangeMan-Prod", 3000, "Production ChangeMan");
                    instances.Add("ChangeMan-Test", 3001, "Test ChangeMan");

                    foreach (ZosChangeManInstance instance in instances)
                    {

                        /////////////////////////////////////////
                        // Add the ChangeMan file format entries
                        /////////////////////////////////////////

                        ZosFileFormatMappings fileFormats = instance.FileFormatMappings;

                        fileFormats.Add(-1, "SRC", ZosFileFormat.AsciiText);
                        fileFormats.Add(-1, "DOC", ZosFileFormat.UnicodeText);
                        fileFormats.Add(-1, "BIN", ZosFileFormat.Binary);
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.TargetSite);
            }
        }
    }
}

Visual Basic Example

...

'**********************************************************************
' Visual Basic Example
'
' File Name: NewConfig.vb
'
' Description: Sample for creating a new configuration.
'
' Usage: NewConfig <userid>
'
' Copyright ©2003-2011, Serena Software. Licensed material. All rights reserved.
'**********************************************************************
Imports System
Imports ZosApi

Module NewConfig

    Sub Main()

        Try
            '----------------------------
            ' Get command line arguments
            '----------------------------
            Dim args As String() = Environment.GetCommandLineArgs()

            If args.Length < 2

                Console.WriteLine("Usage: NewConfig <userid>")
                Environment.Exit(1)

            End If

            Dim userID As String = args(1)


            Dim network As ZosNetwork = new ZosNetwork()

            network.CacheFolder = "C:\Temp"
            network.CacheDays = 3
            network.NotifyPort = 8000
            network.NotifyJobStep = True
            network.NotifyMessageBox = True

            '----------------------
            ' Add the new servers
            '----------------------

            Dim servers As ZosServers = network.Servers

            servers.Add("Server1", "172.20.20.1", 5000, 1140, "Description1")
            servers.Add("Server2", "172.20.20.2", 5000, 1140, "Description2")
            servers.Add("Server3", "172.20.20.3", 5000, 1140, "Description3")

...

...

            '----------------------------------------
            ' Update the properties for each server
            '----------------------------------------

            Dim server As ZosServer

            For Each server In servers

                Dim index As Integer

                '-------------------------------------
                ' Add the data set file format entries
                '-------------------------------------

                Dim dsFileFormats As ZosFileFormatMappings =
                server.DataSetFileFormatMappings

                dsFileFormats.Add(-1, "**.ASCII.TEXT", ZosFileFormat.AsciiText)
                dsFileFormats.Add(-1, "**.ASCII.DATA", ZosFileFormat.AsciiData)
                dsFileFormats.Add(-1, "**.UNICODE.TEXT", ZosFileFormat.UnicodeText)
                dsFileFormats.Add(-1, "**.EBCDIC.TEXT", ZosFileFormat.EbcdicText)
                dsFileFormats.Add(-1, "**.EBCDIC.DATA", ZosFileFormat.EbcdicData)
                dsFileFormats.Add(-1, "**.BINARY", ZosFileFormat.BinaryCRLF)

                '-------------------------------------------------------------
                ' The following illustrates a faster way to do the same thing
                '-------------------------------------------------------------

                Dim fileFormatArray() As ZosFileFormatMapping = _
                { _
                            New ZosFileFormatMapping("**.ASCII.TEXT",
                ZosFileFormat.AsciiText), _
                            New ZosFileFormatMapping("**.ASCII.DATA",
                ZosFileFormat.AsciiData), _
                            New ZosFileFormatMapping("**.UNICODE.TEXT",
                ZosFileFormat.UnicodeText), _
                            New ZosFileFormatMapping("**.EBCDIC.TEXT",
                ZosFileFormat.EbcdicText), _
                            New ZosFileFormatMapping("**.EBCDIC.DATA",
                ZosFileFormat.EbcdicData), _
                            New ZosFileFormatMapping("**.BINARY", ZosFileFormat.Binary) _
                }

                dsFileFormats.FromArray(fileFormatArray)

                '---------------------------------
                ' Add the Unix file format entries
                '---------------------------------

                Dim uFileFormats As ZosFileFormatMappings =
                server.UnixFileFormatMappings

                uFileFormats.Add(-1, "*.TEXT", ZosFileFormat.AsciiText)
                uFileFormats.Add(-1, "*.UTEXT", ZosFileFormat.UnicodeText)
                uFileFormats.Add(-1, "*.BIN", ZosFileFormat.Binary)

                '-------------------------------
                ' Add the library type entries
                '-------------------------------

                Dim libTypes As ZosLibTypeMappings = server.LibTypeMappings

                libTypes.Add(-1, "**.LIBRARY", ZosLibType.Lib)
                libTypes.Add(-1, "**.PANVALET", ZosLibType.Pan)

                '-------------------------------------------------------------
                ' The following illustrates a faster way to do the same thing
                '-------------------------------------------------------------

                Dim libTypeArray() As ZosLibTypeMapping = _
                { _
                    New ZosLibTypeMapping("**.LIBRARY", ZosLibType.Lib), _
                    New ZosLibTypeMapping("**.PANVALET", ZosLibType.Pan) _
                }
                libTypes.FromArray(libTypeArray)

                '---------------------------------
                ' Add the file extension entries
                '---------------------------------

                Dim fileExtensions As ZosFileExtensionMappings =
                server.FileExtensionMappings

                fileExtensions.Add(-1, "**.CNTL", "jcl")
                fileExtensions.Add(-1, "**.COBOL", "cbl")
                fileExtensions.Add(-1, "**.LIST", "txt")
                fileExtensions.Add(-1, "**.WORD", "doc")
                fileExtensions.Add(-1, "**.EXCEL", "xls")

                '-------------------------------------------------------------
                ' The following illustrates a faster way to do the same thing
                '-------------------------------------------------------------

                Dim fileExtArray() As ZosFileExtensionMapping = _
                { _
                    New ZosFileExtensionMapping("**.CNTL", "jcl"), _
                    New ZosFileExtensionMapping("**.COBOL", "cbl"), _
                    New ZosFileExtensionMapping("**.LIST", "txt"), _
                    New ZosFileExtensionMapping("**.WORD", "doc"), _
                    New ZosFileExtensionMapping("**.EXCEL", "xls") _
                }
                fileExtensions.FromArray(fileExtArray)

                '-------------------------------------
                ' Add the profiles for new data sets
                '-------------------------------------

                Dim dsProfiles As ZosDataSetProfiles = server.DataSetProfiles

                dsProfiles.Add(-1, "**.DATA", ZosDataSetType.Seq, ZosRecordFormat.FB,
                80, 0, "DATACLS1", "STORCLS1", "MGMTCLS1", ZosSpaceUnit.Trk, 2, 1, 5,
                "SYSDA", "VOL001")
                dsProfiles.Add(-1, "**.TEMP", ZosDataSetType.Seq, ZosRecordFormat.FB,
                80, 0, "DATACLS2", "STORCLS2", "MGMTCLS2", ZosSpaceUnit.Cyl, 2, 1, 5,
                "SYSDA", "VOL002")
                dsProfiles.Add(-1, "**.LIST", ZosDataSetType.Seq, ZosRecordFormat.VB,
                80, 0, "", "", "", ZosSpaceUnit.Blk, 500, 50, 5, "SYSDA",
                "")

                '-------------------------------------------------------------
                ' The following illustrates a faster way to do the same thing
                '-------------------------------------------------------------

                Dim dsProfileArray() As ZosDataSetProfile =
                _
                {
                _
                    New ZosDataSetProfile("**.DATA", ZosDataSetType.Seq,
                ZosRecordFormat.FB, 80, 0, "DATACLS1", "STORCLS1", "MGMTCLS1",
                ZosSpaceUnit.Trk, 2, 1, 5, "SYSDA", "VOL001"), _
                    New ZosDataSetProfile("**.TEMP", ZosDataSetType.Seq,
                ZosRecordFormat.FB, 80, 0, "DATACLS2", "STORCLS2", "MGMTCLS2",
                ZosSpaceUnit.Cyl, 2, 1, 5, "SYSDA", "VOL002"), _
                    New ZosDataSetProfile("**.LIST", ZosDataSetType.Seq,
                ZosRecordFormat.VB, 80, 0, "", "", "", ZosSpaceUnit.Blk,
                500, 50, 5, "SYSDA", "") _
                }

                dsProfiles.FromArray(dsProfileArray)

                '-----------------------
                ' Add data set folders
                '-----------------------

                Dim dsfolders As ZosDataSetFolders = server.DataSetFolders

                Dim dsfolder As ZosDataSetFolder
                Dim filters As ZosNameFilters
                Dim prefixes As ZosPrefixMappings

                '------------------------------------------------
                ' "My DataSets" folder for all user's data sets
                '------------------------------------------------

                index = dsfolders.Add("My DataSets")
                dsfolder = dsfolders(index)

                filters = dsfolder.Filters
                prefixes = dsfolder.PrefixMappings

                filters.Add(userID + ".**")

                prefixes.Add(-1, "**", userID)

                '-------------------------------------------------
                ' "My Source" folder for user's source libraries
                '-------------------------------------------------

                index = dsfolders.Add("Source")
                dsfolder = dsfolders(index)

                filters = dsfolder.Filters
                prefixes = dsfolder.PrefixMappings

                filters.Add(userID + ".**.COBOL")
                filters.Add(userID + ".**.ASM")

                prefixes.Add(-1, "**.MOUSE", "MICKEY")
                prefixes.Add(-1, "**", userID)

                '-------------------------------------------------------------
                ' The following illustrates a faster way to do the same thing
                '-------------------------------------------------------------

                Dim filterArray() As String = _
                { _
                userID + ".**.COBOL", _
                userID + ".**.ASM" _
                }
                filters.FromArray(filterArray)

                Dim prefixArray() As ZosPrefixMapping = _
                { _
                New ZosPrefixMapping("**.MOUSE", "MICKEY"), _
                New ZosPrefixMapping("**", userID) _
                }
                prefixes.FromArray(prefixArray)

                '------------------
                ' Add job folders
                '------------------

                Dim jobfolders As ZosJobFolders = server.JobFolders

                Dim jobfolder As ZosJobFolder

                '------------------------------------------
                ' "My Jobs" folder for jobs owned by user
                '------------------------------------------

                index = jobfolders.Add("My Jobs", ZosJobQueryType.QueueOwner, userID)
                jobfolder = jobfolders(index)

                '-------------------------------------------------------
                ' "ChangeMan" folder for job names prefixed with "CMN"
                '-------------------------------------------------------

                index = jobfolders.Add("ChangeMan", ZosJobQueryType.QueueJobname, "CMN*")

                jobfolder = jobfolders(index)

                '--------------------------------------
                ' "Active" folder for all active jobs
                '--------------------------------------

                index = jobfolders.Add("Active", ZosJobQueryType.ActiveAll)
                jobfolder = jobfolders(index)

                '------------------------
                ' Add ChangeMan instances
                '------------------------

                Dim instances As ZosChangeManInstances = server.ChangeManInstances

                instances.Add("ChangeMan-Prod", 3000, "Production ChangeMan")
                instances.Add("ChangeMan-Test", 3001, "Test ChangeMan")

                Dim instance As ZosChangeManInstance

                For Each instance In instances

                    '--------------------------------------
                    ' Add the ChangeMan file format entries
                    '--------------------------------------

                    Dim fileFormats As ZosFileFormatMappings =
                    instance.FileFormatMappings

                    fileFormats.Add(-1, "SRC", ZosFileFormat.AsciiText)
                    fileFormats.Add(-1, "DOC", ZosFileFormat.UnicodeText)
                    fileFormats.Add(-1, "BIN", ZosFileFormat.BinaryCRLF)

                Next

            Next

        Catch e As Exception

            Console.WriteLine(e.Message)
            Console.WriteLine(e.StackTrace)

        End Try

    End Sub

End Module

JScript Example

...

/**********************************************************************
* JScript Example
*
* File Name: NewConfig.js
*
* Description: Sample for creating a new configuration.
*
* Usage: NewConfig.js <userid>
*
* Copyright ©2003-2011, Serena Software. Licensed material. All rights reserved.
**********************************************************************/
var userID;

var network;
var servers;
var server;
var fileFormats;
var libTypes;
var fileExtensions;
var dsProfiles;
var folders;
var folder;
var subfolders;
var subfolder;
var filters;
var prefixes;

var enumerator;

//////////////////////////////
// Get command line arguments
//////////////////////////////

if (WScript.Arguments.Count() < 1)
{
    WScript.Echo("Usage: NewConfig.js <userid>");
    WScript.Quit(1);
}

userID = WScript.Arguments(0);

...

...

/////////////////////////////
// Update network properties
/////////////////////////////

network = new ActiveXObject
("ZosShell.ZosNetwork");

network.CacheFolder = "C:\\Temp";
network.CacheDays = 3;
network.NotifyPort = 8000;
network.NotifyJobStep = true;
network.NotifyMessageBox = true;

///////////////////////
// Add the new servers
///////////////////////

servers = network.Servers;

servers.Add("Server1", "172.20.20.1", 5000, 1140, "Description1");
servers.Add("Server2", "172.20.20.2", 5000, 1140, "Description2");
servers.Add("Server3", "172.20.20.3", 5000, 1140, "Description3");

/////////////////////////////////////////
// Update the properties for each server
/////////////////////////////////////////

serverEnum = new Enumerator(servers);

for (; !serverEnum.atEnd(); serverEnum.moveNext())
{
    server = serverEnum.item();

    ////////////////////////////////////////
    // Add the data set file format entries
    ////////////////////////////////////////

    fileFormats = server.DataSetFileFormats;

    fileFormats.Add(-1, "**.ASCII.TEXT", "AT");
    fileFormats.Add(-1, "**.ASCII.DATA", "AD");
    fileFormats.Add(-1, "**.UNICODE.TEXT", "UT");
    fileFormats.Add(-1, "**.EBCDIC.TEXT", "ET");
    fileFormats.Add(-1, "**.EBCDIC.DATA", "ED");
    fileFormats.Add(-1, "**.BINARY", "BT");

    ////////////////////////////////////
    // Add the Unix file format entries
    ////////////////////////////////////

    fileFormats = server.UnixFileFormats;

    fileFormats.Add(-1, "*.TEXT", "AT");
    fileFormats.Add(-1, "*.UTEXT", "UT");
    fileFormats.Add(-1, "*.BIN", "B" );

    ////////////////////////////////
    // Add the library type entries
    ////////////////////////////////

    libTypes = server.LibTypes;

    libTypes.Add(-1, "**.LIBRARY", "L");
    libTypes.Add(-1, "**.PANVALET", "P");

    //////////////////////////////////
    // Add the file extension entries
    //////////////////////////////////

    fileExtensions = server.FileExtensions;
    fileExtensions.Add(-1, "**.CNTL", "jcl");
    fileExtensions.Add(-1, "**.COBOL", "cbl");
    fileExtensions.Add(-1, "**.LIST", "txt");
    fileExtensions.Add(-1, "**.WORD", "doc");
    fileExtensions.Add(-1, "**.EXCEL", "xls");

    //////////////////////////////////////
    // Add the profiles for new data sets
    //////////////////////////////////////

    dsProfiles = server.DataSetProfiles;

    dsProfiles.Add(-1, "**.DATA", "SEQ", "FB", 80, 0, "DATACLS1", "STORCLS1",
    "MGMTCLS1", "TRK", 2, 1, 5, "SYSDA", "VOL001");
    dsProfiles.Add(-1, "**.TEMP", "SEQ", "FB", 80, 0, "DATACLS2", "STORCLS2",
    "MGMTCLS2", "CYL", 2, 1, 5, "SYSDA", "VOL002");
    dsProfiles.Add(-1, "**.LIST", "SEQ", "VB", 80, 0, "", "", "",
    "BLK", 500, 50, 5, "SYSDA", "");

    ////////////////////////
    // Add data set folders
    ////////////////////////

    folder = server.DataSetFolder;
    subfolders = folder.Subfolders;

    /////////////////////////////////////////////////
    // "My DataSets" folder for all user's data sets
    /////////////////////////////////////////////////

    subfolder = subfolders.Add("My DataSets");

    filters = subfolder.Filters;
    prefixes = subfolder.Prefixes;

    filters.Add(userID + ".**");
    prefixes.Add(-1, "**", userID);

    //////////////////////////////////////////////////
    // "My Source" folder for user's source libraries
    //////////////////////////////////////////////////

    subfolder = subfolders.Add("Source");

    filters = subfolder.Filters;
    prefixes = subfolder.Prefixes;

    filters.Add(userID + ".**.COBOL");
    filters.Add(userID + ".**.ASM");
    prefixes.Add(-1, "**", userID);

    ///////////////////
    // Add job folders
    ///////////////////

    folder = server.JobFolder;
    subfolders = folder.Subfolders;

    ///////////////////////////////////////////
    // "My Jobs" folder for jobs owned by user
    ///////////////////////////////////////////

    subfolder = subfolders.Add("My Jobs", "QU", userID);

    ////////////////////////////////////////////////////////
    // "ChangeMan" folder for job names prefixed with "CMN"
    ////////////////////////////////////////////////////////

    subfolder = subfolders.Add("ChangeMan", "QN", "CMN*");

    ///////////////////////////////////////
    // "Active" folder for all active jobs
    ///////////////////////////////////////

    subfolder = subfolders.Add("Active", "A");

    /////////////////////////
    // Add ChangeMan folders
    /////////////////////////

    folders = server.ChangeManFolders;

    folders.Add("ChangeMan-Prod", 3000, "Production ChangeMan");
    folders.Add("ChangeMan-Test", 3001, "Test ChangeMan");

    folderEnum = new Enumerator(folders);

    for (; !folderEnum.atEnd(); folderEnum.moveNext())
    {
        folder = folderEnum.item();

        /////////////////////////////////////////
        // Add the ChangeMan file format entries
        /////////////////////////////////////////

        fileFormats = folder.FileFormats;

        fileFormats.Add(-1, "SRC", "AT");
        fileFormats.Add(-1, "DOC", "UT");
        fileFormats.Add(-1, "BIN", "B");
    }
}
Back to top