|The Tutorials Start Here||Populating the Worksheet|
In this session, you use the Enterprise Edition analysis tools to identify sets of monetary data items.
Please see the Tutorials Map to check that you have been through all necessary previous sessions.
The application used in these Enterprise Edition sessions is supplied with Revolve Enterprise Edition. It is referred to as the Orderapp demo, and relates to part of an order processing application for a mail order company. In this session we suppose that the company has added some very high value items to its range, and needs to check that all its systems can handle the large numbers involved. You will need to look at every line of code that involves money, to work out whether to modify it.
Supplied are the source files - COBOL sources, copyfiles, BMS maps, and CICS resources. The analysis tools find items meeting particular search criteria, and put them into sets that you can manipulate. You use the analysis tools to find all lines of code that are of interest - those involving money, in this case. These are called points of interest (POIs). You can identify them using the following procedure:
This gives you your final list of POIs - lines of code that might need attention and might need decisions from business analysts.
You use the following analysis tools:
Open Revolve Enterprise Edition from the Windows desktop, by clicking Start > Programs > MERANT Revolve TPS > Revolve Enterprise Edition.
If this session has been run before and has created a project and related files in the folder where you intend to create your project, delete them as follows:
To create and build the project for the Order demo:
We will assume that your new folder is in the projects folder you created in the Revolve Getting Started, so that the path is \projects\order.
So the path to this project is \projects\order\order.prj.
The \samples\Enterprise\orderapp contains the source files of the demo. They are in a subfolder called source.
Progress indicators are shown while components are being added.
The Enterprise Edition features are metered on a line-of-code basis, which means that the code has to have been metered before you can process it through the analysis tools. Only one person needs to meter the code and then everyone can process the code without further cost.
The demonstration programs are already metered, so all you need to do is to point to the file that confirms that the code has been metered. This file is called the metering control file.
To ensure Revolve finds the metering control file:
If the Analysis Tools window appears, you do not need to do anything about metering. You are already pointing to the correct metering control file. Skip the rest of this section.
Otherwise, the Metering Wizard opens.
If at any time a message appears telling you that the cache files need to be built, click Build cache files now, then click OK.
To check that the settings of the tools are as required for this session:
If a message appears telling you that the cache files need to be built, click Build cache files now, then click OK.
The Analysis Tools window lists all the analysis tools included in Revolve Enterprise Edition.
All other chapters in this book assume that you have these settings.
First, search for data items with PICTURE formats that could represent monetary values:
This tool looks for data items whose definitions conform to the criteria you've set. These default settings represent items that could hold monetary values. As you can see, as a definition of a monetary data item these criteria are fairly broad.
The tool runs, and searches all the files in the project for items that match the search criteria. Finally it displays a Set View window, showing the set of data items that it found. This window is shown in Figure 4-1.
Figure 4-1: Set View
In the Set View:
If your set contains a different number of data items, check that you used exactly the settings listed in Step 4, by double-clicking the tool in the right-hand pane. If you used different settings, go back and rerun the tool with the correct settings.
Now you start getting to know the sample source code, looking through the data items in the set and finding which data items aren't monetary and so need to be removed from the set. These items for removal are sometimes referred to as false positives.
If you can't see it, you can scroll to it quickly. Click the Sort Ascending button to get the list into alphabetical order, then click in the left-hand pane and type V to get to the first item beginning with V.
This item's name certainly implies it holds a monetary value. However, you might want to look at it in the context of the source code to confirm that it really is monetary.
VAL-P-AND-P-COSTand then click the View Source Code button .
This splits the Set View into two panes with the set at the top and the source file containing the data item's definition at the bottom. If necessary, drag the bottom edge of the Source View and/or the horizontal divider between the two views, so that you can see more source code.
Notice that the definition of
VAL-P-AND-P-COST sets an
initial value of 17.50, which looks like a monetary value. Later we
will capture a set of all such monetary constants.
VAL-P-AND-P-COSTis still highlighted in the Source View, and then click the Next Usage button several times to see where it's used.
The way it's used in the Procedure Division confirms it is monetary.
TEMP-QTYin the Set View at the top and then click several times to see how this item is used.
From its name and the names of the data items it is used with, you can see this is not a monetary item. Later we will remove it, along with other items whose names imply that they aren't monetary items.
CURR-DATE-ACCEPTin the same way.
Since this data item is used to hold the date, it is definitely not monetary and not of interest. In the following sections you search this set to find sets of data items that for various reasons are clearly not monetary, and remove them from this set.
OE01in the same way.
These data items all correspond to BMS fields. Their data definitions are automatically generated from the BMS screen map and so have names ending in L, I, O corresponding to how the data items are used. Some of these data items might refer to monetary fields on a BMS screen, and might need modification. Once again, there is a tool to identify BMS-related data items.
To name and save the set you have created:
Initial data itemsand click OK.
This saves the set in the project directory. Its filename is the name you specified, with the extension .set. Its name now appears in its title bar.
To create a copy of the set so that you can work on it without affecting the original set:
The new set is now ready for you to use as a working set, so that you can refine it, gradually removing the unwanted non-monetary items.
It remains in the Named Sets window, so you can re-open it at any time.
Many of the data items in the working set are irrelevant because they aren't used to process money, but rather are used to help the flow of the program. There is a tool for identifying these data items. It finds, for example, data items controlling PERFORM VARYING statements, and data items to do with dates.
To search the working set for these sorts of data items and remove them from the working set:
If you run an analysis tool by double-clicking it, it searches the source files of the application as defined on the Scope tab of Analysis Tools Options. If you run the tool by dragging a set onto it, it further limits the search to just that set.
On the dialog box, look at the check boxes to see the uses of data items that this tool searches for.
The resulting set contains 46 data items. Notice that these data items are genuinely unwanted, since they represent dates, lengths, error codes, and so on.
The working set now contains 204 data items (250 minus 46). Its history in the right pane, which records the tools and set operations used to create it, is now as follows:
Another set of data items that aren't of interest are those whose names imply they are unlikely to contain monetary amounts. There is a tool to find these items. Since any application has its own naming conventions, you need to specify the kind of names to look for.
To search the working set for data items with these names and remove them from the working set:
We have supplied a list of names for the Order demo, so that you can import this list and run the tool quickly. In the real world you would develop your own list of names as you work on an application and get to know it. You can keep your list in a separate file and pass it to colleagues working on similar or related source files. This not only saves them time but also ensures consistency when any of you rerun the tool.
This imports a set of strings as the search criteria: *date*, *-dd*, *-id*, and so on.
The resulting set contains 95 data items. Scan down the list of data items briefly and confirm that probably none of them is monetary.
The working set now contains 109 data items (204 minus 95). You have now finished deleting false positives from it.
You now look for monetary constants, and the statements and data items associated with them. Monetary constants might represent a fixed amount of money that is added to a customer's bill - for example, a handling or shipping charge. The value of a constant might change substantially if, for example, the company starts shipping very large, heavy items when it has never done so previously.
It is important to identify these monetary constants in the Data Division and the Procedure Division early. Although changing these amounts is easy, determining which need to be changed is typically done by the business analysts and not the IT department. Identifying these constants at an early stage will help the decision process, especially as this information might raise questions or issues that the business analysts had not previously contemplated.
The resulting set contains 66 entries, including both statements and data items.
Click the first entry in the set and click View Source Code. Then press down arrow to show the source for each set entry in turn.
Notice that the entries are either data items defined with constant values, or statements that use those data items, or statements that contain constant values used with the data items in the "Potential monetary data items" set.
The resulting set contains 9 data items.
The Order project you created is used in many sessions in this book.
If you want to take a break before going on to the next session, you can close the project. Or you can close Revolve, with or without closing the project.
Return to the Tutorials Map and choose which session to go on to next.
Comments on the books?
Click Send Us Comments.
Copyright © 2000 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.
|The Tutorials Start Here||Populating the Worksheet|