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.

VBScript Example

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

Dim userID
Dim network
Dim servers
Dim server
Dim fileFormats
Dim libTypes
Dim fileExtensions
Dim dsProfiles
Dim folders
Dim folder
Dim subfolders
Dim subfolder
Dim filters
Dim members
Dim prefixes


'----------------------------
' Get command line arguments
'----------------------------

If WScript.Arguments.Count < 1 Then
    WScript.Echo "Usage: NewConfig.vbs <userid>"
    WScript.Quit(1)
End If

userID = WScript.Arguments(0)

...

'---------------------------
' Update network properties
'---------------------------

Set network = CreateObject("ZosCom.ZosNetwork")

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

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

Set 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
'---------------------------------------

For Each server In servers

    '---------------------------
    ' Add the data type entries
    '---------------------------

    Set 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
    ' This is supported on version 7.1+ servers only.
    ' The lines below should be removed for back level servers.
    '-----------------------------------------------------------

    Set fileFormats = server.UnixFileFormats

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

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

    Set libTypes = server.LibTypes

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

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

    Set 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
    '------------------------------------

    Set 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
    '----------------------

    Set folder = server.DataSetFolder
    Set subfolders = folder.Subfolders

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

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

    Set filters = subfolder.Filters
    Set prefixes = subfolder.Prefixes

    filters.Add userID & ".**"

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

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

    Set subfolder = subfolders.Add("My Source")

    Set filters = subfolder.Filters
    Set members = subfolder.MemberFilters
    Set prefixes = subfolder.Prefixes

    filters.Add userID & ".**.COBOL"
    filters.Add userID & ".**.ASM"

    members.Add "ABC*"
    members.Add "X*"

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

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

    Set folder = server.JobFolder
    Set subfolders = folder.Subfolders

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

    subfolders.Add "My Jobs", "QU", userID

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

    subfolders.Add "ChangeMan", "QN", "CMN*"

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

    subfolders.Add "Active", "A"

    '-----------------------
    ' Add ChangeMan folders
    '-----------------------

    Set folders = server.ChangeManInstances

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

    For Each folder In folders

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

        Set fileFormats = folder.FileFormats

        fileFormats.Add -1, "SRC", "AT"
        fileFormats.Add -1, "DOC", "UT"
        fileFormats.Add -1, "BIN", "BT"

    Next

Next

...

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 members;
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("ZosCom.ZosNetwork");

network.CacheFolder = "C:\\Temp";
network.CacheDays = 3;
network.NotifyPort = 8000;
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
    // This is supported on version 7.1+ servers only.
    // The lines below should be removed for back level servers.
    //////////////////////////////////////////////////////////////

    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;
    members = subfolder.MemberFilters;
    prefixes = subfolder.Prefixes;

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

    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.ChangeManInstances;

    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