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.
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.
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.
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.
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.
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.
In this session you:
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:
If this session has been run before, you get a message box asking whether to overwrite the existing project. Click Yes.
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.
To add the data files to the catalog:
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 |
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:
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.
To complete our realistic scenario, we need to create the generated files on the server and ensure they run:
The application runs in the Application window. It is similar to Idedemo and Sccdemo
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:
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.
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.)
To remove the source files from the project:
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.
Now add a new workgroup level to Scwkmast, as in the chapter Using Workgrouping, that is:
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.
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.
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:
If this session has been run before, you get a message box asking whether to overwrite the existing project. Click Yes.
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).
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.
To create a project from the project template:
If this session has been run before, you get a message box asking whether to overwrite the existing project. Click Yes.
So that's the user's project created. It is an exact copy of the project template.
To get files out for editing or in order 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.
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.
The application runs as before. When it finishes, close the Application window.
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:
The Check Out File(s) dialog box appears. It shows the three source files that are not checked out.
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.
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.