PreviousMetering Lines of Code The Worksheet and Group WorkingNext

Chapter 8: Finding Points of Interest

This chapter describes how to find the monetary points of interest in an application.

8.1 Introduction

The analysis tools are for finding the points of interest in an application and adding them to the worksheet. Each analysis tool produces a set of potential points of interest (candidates) based on one attribute, such as the candidate's name, its type and size, its value, its usage and so on.

Figure 8-1 shows an example view of a set. The candidates in the set are listed in the left-hand pane. The right-hand pane shows a history of how the set reached its current state. You can also optionally display the source program or copybook, where it is known, or view relevant source code.

Figure 8-1: Example Set View

8.1.1 Process for Finding Points of Interest

Once you have created a project for your application, loaded the source files into the project database and metered the source code, the process for identifying the monetary points of interest in your application is broadly:

  1. Investigate on a small scale: limit the scope of your analysis and run the tools. This helps you to see what types of item you will extract and you can also roughly gauge the effort involved in remediation. You can also decide what settings and customized tools would be useful.

  2. Finalize settings for the tools and any customized tools. Reset the scope of your analysis to encompass the whole project.

  3. Run the relevant tools to find the monetary elements. Examine the sets and manipulate them by combining them or producing subsets, until you're confident the set contains the items you need.

  4. Add the set to the worksheet, assigning the appropriate categories and recording any notes. You can add candidates to the worksheet at any time. You can add just one candidate, or several, if you don't want to add the entire set. The worksheet is automatically saved when you leave EuroSmart (usually, to a file called projectname.mdb).

  5. Repeat the process of creating sets, examining them and manipulating them before either adding them to the worksheet or removing them, as appropriate.

Warning: Do not edit the original source code during the finding process. If you do, you will need to restart the project from the beginning, reparse the database and repopulate the worksheet.

8.1.2 Commonly Used Analysis Tools

There are lots of analysis tools but you're likely to use some more than others, simply because monetary data items share several attributes, such as being numeric and having at least a certain number of digits.

The list below outlines some of the tools you're likely to use most frequently:

8.2 Types of Points of Interest to Find

This section lists common points of interest you are likely to want to investigate in your project:

8.2.1 Numeric Constants that Represent Currency Values

Numeric constants can take several forms, including:

Constants used with data items and statements gives a set of data items and statements that include or use constants. You can use it to pick up all except those read in at the start of a program. However, this tool also picks up many values that are of no interest. You can refine the set in steps by using various tools, but at each step you need to provide progressively more application-specific criteria.

Use of data items requires little detailed knowledge, and allows you to remove from your set any data items that don't appear to be monetary, such as subscripts and program control devices.

Names of data items allows you to specify portions of names that you know preclude them from being currency items; for example, names containing the string 'date'.

Your knowledge of the application may allow you to use some of the other tools to refine the set further, based on attributes such as the data format or its context.

8.2.2 Alphanumeric COBOL Constants that Label Currency Units

Alphanumeric constants that label currency include:

You can use Literals to find alphanumeric literals, restricting your search to specific substrings. Specifying what substrings to look for is a matter of judgment and several iterations of the tool might be required to ensure that spurious literals are excluded but all potential literals are considered.

8.2.3 Alphanumeric BMS Constants that Label Currency Units

Screen items that are declared in BMS maps but have no name can be considered as equivalent to COBOL literals. The worksheet and analysis tools do not provide help in finding these items. The only reliable method is a visual inspection of the screens using Screens on the Browser menu.

8.2.4 BMS Maps that Show Currency-related Values

BMS screens that display monetary values are obvious candidates for change. Even if the size of the currency fields doesn't need changing, you may want to rearrange the positions of the items or add currency labels to improve clarity in the changeover environment. The worksheet and tools do not handle BMS items directly. However, as each named BMS field generates at least one corresponding data item in BMS copybooks, these generated data items can be used as proxies for the BMS items themselves.

BMS-related data items allows you to select, or filter, data items that are related to BMS fields. To select the input and output values, you might need to use Names of data items to choose the appropriate name suffixes. Use a suitable category to ensure that only the BMS fields and screens are changed during the fix process, not the data items themselves.

8.2.5 Currency-related Fields that are Used in Data Files and Databases

Depending on your mode of changeover (big-bang or graduated), when your application starts to use the euro, you need to have converted any current data held in files or databases, so you must identify all the files, records, fields, tables and columns that need converting:

Once you have a full list of data items in the worksheet, suitably categorized, you can use this list as input to your database conversion project.

8.2.6 Currency-related Fields that are Abbreviated

Although most data items that hold currency values will be the correct size to hold the minimum currency unit, some will invariably be 'abbreviated' in one of the following ways:

Although an application might allow two decimal places for a currency, items such as delivery charge could still be expressed as an integer number of currency units. After conversion, it may be appropriate to express the amount as an integer number of euros, but if customers expect an exact conversion, then the converted euro amount will need expanding to include two decimal places.

If a credit limit is always expressed as hundreds of thousands of a currency unit, then the data item may be scaled, either explicitly using the COBOL PICTURE string P or implicitly with an integer field with each unit representing one hundred thousand currency units. There is no general way to discover these items. By knowing your application, you could deduce which items are likely candidates and be able to pick them out with Names of data items using suitable strings for the names.

8.2.7 Currency-related Fields that Have Insufficient Size

If your application works with the Belgian Franc, Italian Lire or Spanish Peseta, it will typically handle the currency as an integer value throughout. To convert this for use with the euro, each data item that handles a currency must allow two decimal places. You might wish to restrict the maximum integer size of the items at the same time.

For applications that work with other currencies, it might be necessary to consider the size of currency fields. After conversion, the euro values may generally be similar in size to the pre-conversion currency values, but items that hold totals, sub-totals or are used in calculations may become too small and need expanding by a decimal place or two.

It isn't easy to find all the data items reliably. You will have to use several tools and make full use of your knowledge of your application.

Use Format of data items to produce an initial list of potential currency data items and eliminate obvious non-currency items with Use of data items. Using your knowledge of an application, you may be in a position to identify names with substrings that identify data items as being currency-related or not currency-related using Names of data items.

8.3 Setting Up the Analysis Tools

Each analysis tool searches the specified project components for items that match the criteria you define, and then presents the matching items as a set. For example, to find monetary-related text, you might specify DM, PF, Mark and Pfennig as criteria. There are two ways of doing this:

Before running the analysis tools, you decide how to use them:

8.3.1 Changing Tool Settings

Although you can supply fresh tool settings each time you run a tool, this doesn't guarantee a consistent method of locating points of interest, especially if you are working on a group project. For this reason, you might use the various settings facilities, which are:

Note: Custom criteria other than those you specify using the Configuration Wizard only apply until you close the project. If you specified criteria for an analysis tool and you want to preserve them, run the Configuration Wizard and select that tool so that the settings are saved as a new group of settings.

8.3.2 Creating a Customized Tool

If the tool settings and the analysis process you used to find a set of specific points of interest is extremely complicated, but you need to be able to repeat it or share the process, you can save it as a customized euro tool which you add to the analysis tools list. Then you can use it for other projects and in group projects. Using the same tool ensures consistency and saves effort when complicated selection processes are required. You create a customized tool by right clicking on the audit trail of a set and selecting Create Tool.

Facilities for sharing customized tools are currently limited. All your tools are stored in one file and there is currently no way to merge your tool file with anyone else's.

To work around this problem, one person needs to maintain the master tool file, which you can then distribute to other users. The file containing the customized tools is toolcomp.dat and is located in the project directory.

8.4 Working with Sets

Each time you run a tool, a fresh set is produced. This means that you can always have a think and start again if you run a tool and the resulting set is not what you expected. Remember to delete any unwanted sets, though. It can be quite confusing when there are several sets in the project window.

8.4.1 Creating and Filtering Sets

You can create sets of data items and statements from a number of starting points. You can create a set from:

You can also expose a set to further refining by an analysis tool, by dragging the set onto the tool and specifying the required criteria. The contents of the resulting set depends on the tool.

8.4.2 Manipulating Sets

You can manipulate sets in the following ways:

The history of the set is maintained in the right-hand pane, so that you can see how you arrived at the current set. The history states how you first generated the set, the analysis tools you subsequently used on the set, and the other sets or subsets you combined with this set. To see the criteria that you specified for an analysis tool, double click the name of the analysis tool in the right-hand pane.

8.4.3 Combining Sets

You can combine a whole set with another set, using the following set operations:

Set operation:
Intersect Removes from the target set any candidates that aren't also in the dragged set. The resulting target set contains only the candidates that are common to both sets.
Union Adds the contents of one set to another or to the worksheet.
Subtract Removes the contents of one set from another or from the worksheet.

To combine a whole set with another set, pick up the whole set by pointing to Pick up set in the Set View, and dragging it to the target set. If you hover over the target set before dropping the dragged set onto the target set, a menu pops up for specifying how to combine the sets.

Alternatively, instead of hovering and waiting for the menu to appear you can use a key in conjunction with dragging with the mouse, as follows:

Set operation:
Mouse + key:
Intersect Intersect Drag
Union Union Ctrl + drag
Subtract Subtract Alt + drag

8.4.4 Combining a Subset with a Set

You can combine a subset with another set using the same set operations as for combining a whole set: intersect, union or subtract.

To combine a subset, you select just the set entries you want and drag those to the target set. You can hover over the target set and choose the required set operation. Similarly, you can use a key combination with the mouse.

Note: Set operations on a subset destroy the integrity of the resulting set. The resulting set is no longer considered pure. It is no longer a product of manipulating complete sets using known criteria, and this step cannot be precisely recorded in the history of the set in the right hand pane of the Set view. This means that you cannot reproduce the set automatically, but you have to repeat the manual step if you want this set again.

8.4.5 Naming, Saving and Deleting Sets

Sets are transient and you don't need to keep them. As you work, you probably produce interim sets that you won't need again. If you need to, you can:

There might be occasions when you want to go back to a previous set, or you might want to save a set between sessions. To enable this, you name the set.

To name a set, go to the Name tab of Options Options in the relevant Set View and specify a name. The set is saved to disk with the name you specify and the suffix .set. It's stored in the project directory.

When a set has a name, you can:

If you change a named set and then try to close it, you're automatically asked whether you want to save the set.

Alternatively, you can save it manually if you want to keep the changes:

We recommend keeping sets only temporarily, because once you have identified some genuine candidates, it is best to add them to the worksheet. Sets are temporary, whereas the worksheet is the permanent record of the points of interest. Sets are partial information, whereas the worksheet is a complete database on disk and is immediately updated whenever you make any changes. Only the group worksheet enables you to share information, and you can't share sets.

8.4.6 Moving Sets to and from the Worksheet

You can add a set or subset to the worksheet or remove one from it, in the same way as you combine other sets and subsets. You can also take selected worksheet entries and make them into a set or combine them with an existing set.

When you combine a set or subset with the worksheet:

The result is by default a union of the set or subset and what was in the worksheet. You are told how many candidates are added or removed.

If you subtract a set or subset from the worksheet, any candidates in the set or subset that match those in the worksheet are removed from the worksheet. The candidates are not deleted but are moved to the removed list, the same as if you had used Remove Remove from list.

If you add a set or subset to the worksheet, any candidates in the set or subset that are already in the worksheet's removed list, stay in the removed list. They don't get reinstated.

When you drag selected entries from the worksheet, you can:

You can also highlight the candidates in the set that are already in the worksheet. To do this, use Options Options in the Analysis Tools and check Colorize items that exist in the worksheet on the Set Viewer Options tab.

Copyright © 1998 Micro Focus Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.
PreviousMetering Lines of Code The Worksheet and Group WorkingNext