Reporting on the Worksheet | Revolve/2000 |
This chapter describes how using SmartFind Wizard you can find lines of source code that could become points of interest (POIs) in verifying or fixing code. SmartFind Wizard generates a Candidate List, providing an effective method of finding date related source code.
You use the SmartFind Wizard to generate a list of candidates which could become POIs when moved to the worksheet. They are based on a range of attributes of the candidates, such their names or their type and size. You can generate a candidate list with the default settings of SmartFind Wizard or you can customize the settings.
The standard candidate list is built by the default settings of the Candidate Wizard. This uses preset search criteria, filters and rules for identifying the potential candidates. These form the candidate list. You can then examine the candidates in more detail and reduce their number until the list contains only genuine points of interest that need to be verified or fixed.
To build the list, in the Year 2000 menu, select SmartFind Plus, click Candidate Wizard and then select Standard, click Next and Finish. The wizard will automatically start the find process. In general terms, the wizard finds the candidates in two stages by:
You can now use Add to Worksheet to take selected candidates from the candidate list and add them to the project's worksheet. When in the worksheet the candidates become points of interest. You then work from the worksheet removing and adding points of interest. Ultimately, the worksheet contains all the genuinely date-related points of interest and their verification categories or fixes.
Building a custom candidate list enables you to tailor the searches to suit your application, such as an application that never uses data items of a particular type for dates. The custom list also gives you the flexibility to tailor the candidate list to precisely the elements you want to work on, such as only those of a specific size. It also gives you a shortcut to finding the candidates in a specific area.
To build the list, in the Year 2000 menu, select SmartFind Plus, click Candidate Wizard and then select Custom, click Next and where appropriate configure the search pattern then click Finish. In general terms, the wizard finds the candidates in two stages by:
You can choose any or all of the following to define the scope of the candidate list, and so what to examine for inclusion in the list:
You can specify the following criteria to include the corresponding candidates in the candidate list:
Note: When the wizard has built a custom candidate list, the wizard does not set the default filters and the SmartFind Plus usage rules. To set them yourself, use Data item filters and Usage inclusion on Display Filters in the SmartFind candidate list window.
You can now use Add to Worksheet to take selected candidates from the candidate list and add them to the project's worksheet. When in the worksheet the candidates become points of interest. You then work from the worksheet removing and adding points of interest. Ultimately, the worksheet contains all the genuinely date-related points of interest and their fixes.
When you build a candidate list, you can search for data items based on their names. You can specify the exact names or partial names of data items. For example, you can search for all data items with DATE anywhere in the name by specifying *DATE*, where * represents a match with any character and any number of them, and where the name is not case specific.
After building the candidate list, you can also make exceptions to the name criteria. For example, you might want to exclude *UPDATE, even though you included all data item names with *DATE*. You do this by filtering out the unwanted items.
In addition, you can expand the candidate list to view all the statements where each data item is used. You can filter out data items that you are not interested in, such as data items declared as 88-level conditionals with ALL clauses.
Note: If you give the full name of a data item to include it in the candidate list, it stays in the list regardless of any filters you set.
When you build a customized candidate list, you can search for data items based on their data definitions of size and data type, or a mixture of both the name and the data definition.
You can find data items based on size and data type - you specify each combination of size and data type that you want when you build the candidate list. For example, you can search for data items of character display and 6 characters long, as defined in the following line:
03 ws-something PIC X(6).
When you are building a customized candidate list, you can include literals that might be date-related, such as the literal 19, which might be used in the following statement:
MOVE 19 TO century
In the same way as specifying data items by name, you specify the exact or partial literals that are potentially date related when you build the customized candidate list.
When building the candidate list, you can include date-related text strings in text components of your project. Text components are unparsed source code, such as non-COBOL programs, that are loaded into the database as part of your project. For example, the following text line is found as matching the text string *DATE*:
today-date = "Nov 5, 2006"
In the same way as specifying data items by name, you specify the text strings you want when you build the candidate list.
Having built the candidate list, you can manipulate it in a number of ways to examine its contents. You can reorganize the list on different bases, such as by data item or by program. You can also access the source code directly from the candidate list, click to divide the screen.
The candidate list is displayed in hierarchical folders, which you can open and close by double-clicking the folders or click one the buttons
The top-level folders represent the candidate's category that you choose. Each folder might represent a data item, and when you open the folder, you see the lines of code where that data item is used. Alternatively, each folder might represent a program, and when you open the folder you see all the program's candidate data items, each in their own folders, which you can open to see the relevant lines of code. For more on these display hierarchies, see the section Refining the Candidate List.
The candidate list gives details on each candidate. Most of the columns give data item-specific detail, although the source program or copybook is shown for all candidates, where it is known.
A data item's match flags indicate the criteria and filters that the data item matches. They show why the data item was included in the list, by showing which of the wizard's criteria it matches. The match flags also show which data items you can filter out of the list, by virtue of their matching the currently specified filters.
Use Status Bar to turn on and off the status line at the top, which shows how many matches there are. The number of matches corresponds to the type of candidates you are displaying. For example, it might show the number of programs that contain candidates, or the number of candidate data items.
You can choose how to structure the candidate list and on what basis to sort it, such as in alphabetical order of data item or program, or in order of the size of the data items. You use Display Filters to do this, and check the category of element you want to sort on.
Use View Source Code to display the source for the candidate you have selected in the candidate list. This divides the window. The top part shows the candidate list with one of the candidates selected, and the bottom part shows the source code of the selected candidate. This enables you to analyze the code in more detail and modify directly.
You can refine the candidate list in various ways, as described in the Worksheet chapter.
We recommend using the worksheet to refine the candidates. It is simpler and more effective to add candidates to the worksheet and to refine them there.
It is possible to refine the list based on how the candidates are used. To do this, use Usage inclusion on Display Filters. You can specify the SmartFind Plus recommended usages, which captures only suspect operations (operations that cause a logic problem when processing dates). These operations include comparisons, subtractions, sorts, etc.
You can save the candidate list at any stage, and also the criteria you used to build it. You can reload either of these later when you want to continue working on them.
As well as saving complete candidate lists separately, you can save selected candidates in a worksheet together with other candidates you have previously saved there. You then have one central point to work from for fixing, tracking status, reporting and verifying. You can add to the worksheet at any time.
The following options are available:
Click this:
|
To do this:
|
---|---|
Add to Worksheet |
Saves the selected data items and statements in the SmartFind Plus worksheet, together with any already there. The worksheet has the .mdb extension and is automatically saved when you leave SmartFind Plus. |
Save to File |
Saves the candidate list to a text file, for which you can choose the filename and location. The candidate list is saved expanded or compressed to the same extent as it is currently displayed. |
Save Date Research |
Saves the candidate list and the criteria you used to include candidates in the list together with the filters you used for excluding candidates and the individual candidates that you removed. Also any impact information you collected from an Impact Analysis is saved. All this research is saved in a file with a .rev extension. |
Save Date Criteria |
Saves the criteria you used to include candidates in the candidate list, together with the filters you used for excluding candidates. The criteria is saved in a file with a .cri extension. |
Load from File |
Reloads the specified date research file (.rev) that you previously saved, or the specified the date criteria file (.cri) that you previously saved. |
Reporting on the Worksheet | Revolve/2000 |