Chapter 15: Source Control and Workgrouping

Use the Source Control interface together with workgrouping to give multiple users controlled access to development versions of files in a project that is in production use.


You need to have read the chapter Start Here for the Tutorials and worked through the sessions Using Mainframe Express, Using Workgrouping, and Source Control before you do this session.

You need to have an SCM installed to do this session. The SCM used in all examples is PVCS Dimensions from MERANT.

Ideally, you should have access to a network server. However, if you don't, you can use a local drive to represent a server drive.


15.1 Overview

As you saw in the chapter Using Workgrouping, the use of workgrouping introduces levels into a project, reflecting the development level of source files. The base level, called Production, contains those revisions that are currently in production use; subsequent levels, called by default Testing #1, Testing #2, etc, contain revisions under development. Normally, when you carry out a function on a project, for example build it, Mainframe Express picks up the highest (latest) level of each file; but, by unchecking a particular level in the Workgroup View in the project view, you can make it ignore that level and pick up the revision of that file from the next earlier level.

In a typical case, the project stores an absolute path , such as s:\Production\Payroll, for the Production level, which is normally on a server. It stores a relative path, containing a placeholder called <Project folder>, for Testing #1. The placeholder gets replaced at run time by the name of the folder containing the project file, which is usually on a developer's machine.

Because an SCM stores and returns successive revisions of a file, we need to show how an SCM and workgroups work together.

15.1.1 Workgroup Paths and Source Control

In Mainframe Express workgrouping, each level - Production, Testing #1, Testing #2, etc - has its own path.

If you Check Out or Get a source file that is in a Mainframe Express project, Mainframe Express sends the SCM the whole path as shown in the Files View, and the SCM delivers it to that path. But this may not be the correct path for the workgroup level you want it to go in. Typically, the path shown is for the Production level, but you want the file to go to Testing #1.

You can get around this by removing the files from the project after adding them to source control. If you do a Check Out or Get on a project that has no source files, Mainframe Express simply asks the SCM for all files stored in the SCM location for that project (in the case of Dimensions, under the Product and Workset for the project). Then, when the SCM returns these files, Mainframe Express puts them in the path for the highest active workgroup level.

15.1.2 Template Projects

Mainframe Express has a facility for an administrator to create template projects, from which individual users (usually developers) can create their own projects.

Template projects differ from ordinary projects only in location - they are kept in a special location, configurable in Mainframe Express. When you are creating a project, if you specify you want to base it on a template, you select it from a list of the templates stored in this location.

15.1.3 This Session

The demo application used in this session is called Scwkdemo. It is similar to Sccdemo, which you used in the chapter Source Control.

At most sites, setting up a project, setting up the workgroups within it, adding it to the SCM, and creating a template project from it, are tasks that an administrator would do. In this chapter, you do these tasks - it is convenient for the purposes of the tutorial, and will give you useful background knowledge. You will then go on to tasks that a normal user of Mainframe Express would do, creating your own project from the template project and using the workgroups within it.

15.2 Preparation

Before you start, ensure that you have the information to enable you to log in to your SCM. You got this from your administrator when you worked through the chapter Source Control. The information you need is listed in the section Preparation in that chapter.

In real life there would probably be a server drive where the production level of the project was kept and run. Throughout this session we will refer to this drive - or your local drive representing this server drive - as s:. Please substitute whatever drive letter you are using.

You have already seen how to create a project, in the chapter Using Mainframe Express. To save you creating the project used in this session, we supply the project scwkdemo.mvp. We do not know what drive your files will be on, so you have to add the data files to the catalog yourself during the session. But the correct path to your source files gets inserted during the session, so we have been able to add the source files to the project for you.

To prepare for this session: if you have closed Mainframe Express, open it as before. Close any project windows and any other windows that are open. Do not open any project.

15.3 Sample Session

In this session you:

15.3.1 Creating the Master Project

In a real situation, you would have the production files in a directory on the server, belonging to a master project. First we will set up a situation like this, by copying the supplied project.

To create the master project:

  1. Click File > New, select Project and click OK.

  2. Enter Scwkmast as the project name, and s:\production\scwkmast as the path. Click Next.

    If this session has been run before, you get a message box asking whether to overwrite the existing project. Click Yes.

  3. Select Copying an existing project file.

  4. Check the box Copy all files from project/template folder.

  5. In the field for the existing project file to be copied from, enter the name of the supplied project - that is, d:\mfuser\projects\gsdemo\scwkdemo\scwkdemo.mvp. You can type it or Browse to it.

  6. Click Next then Finish.

    If this session has been run before, you get a message box asking whether to overwrite an existing file. Click Yes to All to overwrite all the files that have been left there.

    The project is created. Because you checked Copy all files from project/template folder, all Scwkdemo's files (both source and data) are copied to Scwkmast's folder on the server.

15.3.2 Adding Data Files to the Catalog

To add the data files to the catalog:

  1. Add the data files to the catalog in the usual way - click the Catalog tab and for each of the three files in the following table right-click in the Catalog View and use Add Existing Dataset to add the details given here. It's not necessary to add them to the project.

    If this session has been run before, you may find the catalog already has entries for these files (and for a number of output files from the previous run). In this case you don't need to add them again.

    The files are in s:\production\scwkmast\data.

    DS Name PC Filename DSORG RECFM LRECL
    VSAMDEMO.INQUIRY.DATA salesinq.dat PS VS 534
    VSAMDEMO.SALEDATA.DATA saledata.dat PS FB 26
    VSAMDEMO.VSAMINIT.DATA vsaminit.dat PS FB 80

15.3.3 Specifying the Catalog Location

In the following sections you create several projects, in different locations, based on this one. You need to ensure that each of these projects will look for the above input data files in s:\production\scwkmast\data.

To do this, you specify an absolute path to the catalog instead of the default relative path, so that all these projects will pick up the catalog you just created:

  1. Click Project > Project settings.

  2. Enter s:\production\scwkmast\Catalog.dat in the System Catalog field, and click OK.

    While here, look at the Allocation Folder field. It is set to .\DATA. This relative path (copied from the supplied project Scwkdemo) means that output data files will be created in the subfolder data within the project folder.

15.3.4 Building the Project

To complete our realistic scenario, we need to create the generated files on the server and ensure they run:

  1. Build the project (click g ).

  2. Run the application in the usual way - in the Files View or Workgroup View, select vsamdemo.jcl and click g .

    The application runs in the Application window. It is similar to Idedemo and Sccdemo

  3. Close the Application window.

15.3.5 Adding Files to Source Control

We have now set up a fairly realistic situation - we have the "production" files - source, generated files, and data files - in a directory on the server, and they belong to a master project.

In the next few sections we modify the master project to use source control and workgrouping.

First, add the project and its files to source control:

  1. Click Source Control > Add to source control.

  2. If you are not currently logged in, you are prompted to login. Login as appropriate for your SCM.

  3. You are prompted to connect. Connect as appropriate for your SCM. If this session has been run before, the procedure will be slightly different, because this time the project marker file already exists.

    For example, with Dimensions click Select Project. Select the project Scwkmast\Scwkmast.mfe from the dropdown list, accept the defaults for the other fields, and click OK. Then it connects to the existing project marker file.

  4. On the Add File(s) to Source Control dialog box, uncheck Keep Checked Out. Then put check marks by all four files and click OK.

    All four source files now have SCC Status fields showing Not checked out. (If you forgot to uncheck Keep Checked Out, do Undo Check Out.)

15.3.6 Removing the Source Files

To remove the source files from the project:

  1. In the Files View, ensure Project is selected in the left-hand pane, so that all the files are visible in the right-hand pane. Click Ctrl+A to select all four source files, right-click, and click Remove 4 files.

  2. In the Remove Files from Project dialog box, uncheck Also delete Generated Files.

  3. Click OK.

    The numbers by the entries in the left-hand pane show that there are now no source files in the project. But the generated files are still there, though you cannot see them via any view onto the project, because there are no longer any sources to connect them to.

15.3.7 Creating a Working Level

Now add a new workgroup level to Scwkmast, as in the chapter Using Workgrouping, that is:

  1. Click the Workgroup tab.

  2. Right-click Production, click Add Level, and click OK on the message about relative locations.

    This replaces <Project folder> in all the file pointers in this project by s:\production\scwkmast, the actual location of this project. We will see this in a moment.

  3. On the Add Level dialog box, simply click OK.

  4. On the message warning that the folder already exists in the Production level, simply click OK.

    You get this warning because <Project folder> on your machine for this project points to s:\production\scwkmast. However, the eventual user project will not be created on the s: drive, so there will be no conflict.

    If you expand parts of the tree view in the left-hand pane and click various entries, you see that the paths for the Production level now point to subfolders within s:\production\scwkmast, while those for the Testing #1 level point to subfolders within <Project folder>. Whatever you highlight in the left-hand pane, no source files are visible in the right-hand pane.

  5. Close the project.

15.3.8 Creating the Project Template

So our master project is now complete. We now want to create a project template from it, which can be distributed to users for them to create their own projects.

To create a project template:

  1. Click File > New, select Project and click OK.

  2. Enter Scwktmpt as the project name, and s:\templates\Scwktmpt as the path. Click Next.

    If this session has been run before, you get a message box asking whether to overwrite the existing project. Click Yes.

  3. Select Copying an existing project file.

  4. In the field for the existing project file to be copied, enter the name of the master project - that is, s:\production\Scwkmast\Scwkmast.mvp.

  5. Click Next then Finish.

    So that's the project template created. It is an exact copy of the master project. Its paths still point to the files in s:\production (the files were not copied into s:\templates, because we did not check Copy all files from project/template folder).

  6. Close the project.

15.3.9 Issuing the Project Template

As administrator, you would now make this template project available to all your users, for them to create their own projects from. There are two ways of doing this.

By default, Mainframe Express regards d:\mfuser\templates as the templates folder. As you will see in a moment, when you are creating a project from a template, Mainframe Express shows you a list of the templates available; this list consists of all the project files in subfolders of this folder. One way to issue your template is to send it - that is, its .mvp file - to all users, with instructions to put it into d:\mfuser\templates.

But generally it is more convenient to tell all your users to reconfigure Mainframe Express to look at the templates folder on the server. This is what we will do here.

From here on you are doing what an ordinary user would do.

  1. Click Options > Project. You do not need any project open.

  2. In the Templates folder field, enter (by typing or browsing) s:\templates\.

  3. Click OK.

15.3.10 Creating a User Project

To create a project from the project template:

  1. Click File > New, select Project and click OK

  2. Enter Scwkuser as the project name, and d:\mfuser\projects\gsdemo\Scwkuser as the path. Click Next.

    If this session has been run before, you get a message box asking whether to overwrite the existing project. Click Yes.

  3. Select Using a template project file and select Scwktmpt.

  4. Click Next then Finish.

    So that's the user's project created. It is an exact copy of the project template.

15.3.11 Accessing the Application

To get files out for editing or in order to run the application:

  1. In the Workgroup View, make sure there is a checkmark by Testing #1 in the left-hand pane.

  2. You can now get the source files out to edit. They will be put on your machine in the location you designated as Testing #1 level. We will just get out vsamdemo.jcl and use it to run the application.

    Click Source Control > Check Out.

    The Check Out File(s) dialog box appears. It shows all four source files, even though the project itself shows none.

    Notice that the paths show the project folder on the current machine (possibly abbreviated with "..." to fit in the field). It has dynamically replaced <Project folder>, so that the file returned from the SCM is put in the correct location for a source file in the Testing #1 level, d:\mfuser\projects\gsdemo\scwkuser\source.

  3. Put a checkmark by .....\vsamdemo.jcl and click OK.

    The file vsamdemo.jcl is checked out.

    In the Workgroups View, the number (1) appears by Testing #1 in the left-hand pane, showing the project now contains one source file, which is in Testing level #1. If you select Testing #1, vsamdemo.jcl appears in the the right-hand pane, with SCC Status of Checked Out.

    If you look at the Files View you will see there too that the project now contains this one source file. The file has been added to the project, with a path that locates it in the Testing #1 level.

  4. Run the application - in either view, select vsamdemo.jcl and click g .

    The application runs as before. When it finishes, close the Application window.

15.3.12 Removing the Archives

You should delete the archives created in this session, in case the session is to be run again. You need to add them all to a project so you can do this via Mainframe Express:

  1. Click Source Control > Check Out.

    The Check Out File(s) dialog box appears. It shows the three source files that are not checked out.

  2. Put checkmarks by all of them and click OK.

  3. In the Files View, select Project so that all files in the project are visible.

  4. Click in the right-hand pane, click Ctrl+A to select all the files, and then click Source Control > Undo Check Out.

  5. Click in the right-hand pane, click Ctrl+A to select all the files, and then click Source Control > Remove from Source Control.

    This removes all revisions of all the archives. It does not remove the project marker file. As you saw above, if this session is run again the project will connect to this project marker file instead of creating it.

15.4 Before Continuing

Close the project.

You may wish to reset your templates folder to d:\mfuser\templates (use Options > Project as above).

If you want to take a break before going on to the next session, you can close Mainframe Express.

Return to the Tutorials Map in the chapter Start Here for the Tutorials and choose which session to go on to next, depending on your interests.


Comments on the books? Click Send Us Comments.


Copyright © 2001 Micro Focus International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.