Getting Started in Code Search

Code Search is project related. It executes a search over all verified files in the project.

This section describes a sample use of Code Search that should help you get oriented in the tool. Assume that you want to create business rules for segments of code that write to a file.

  1. In the Code Search pane, click the Top view link. The Top view opens.
  2. Double-click the Rule Finder category. The Rule Finder view opens.
  3. Click the New List Button button on the tool bar. The New List dialog opens.
  4. Enter File Writes and click OK. An empty list named File Writes is added to the Rule Finder view.
  5. Select the File Writes list, then click the Down Arrow Icon button next to the Search Button button on the tool bar. In the drop-down, choose the type of object you want to execute the search against, COBOL File in our example. The Search window opens.
  6. In the Search In drop-down, select All Objects.
  7. Expand the Data Ports folder in the lefthand pane, then expand the Files folder. Select the predefined File Writes criterion and click Find All Constructs. Interactive Analysis displays a dialog box with the results of the search operation. Click OK. A message with the number of constructs found is displayed. Click OK. The Search window is dismissed and the results of the search are displayed in a Code Search view, named after the File Writes list.
    Note: Modify the predefined search criterion or create your own search criterion as you do in the Advanced Search facility.
    Tip: To add a construct manually to the list for a source file, select the source file in the File Writes view, select the construct in the Source or Context panes, then click the New List Button button on the tool bar.
  8. Click the Down Arrow Icon button next to the Run Button button on the tool bar and choose Create Rules in the drop-down menu. A message saying You are about to generate templated business rules into a specified rule set. Continue? Click Yes to continue. The Create Rule Set window opens.
  9. Select an existing Business Function from the drop-down list or create New one:
    1. If you choose New, the Business Function window opens.
    2. Enter Business Area (or select one from the drop-down list).
    3. Enter Name.
    4. (Optional) Enter Technical Description.
    5. (Optional) Enter Business Description.
    6. Click OK to create the business function and to return to the Create Rule Set window.
    The newly created Business Function is selected. The Name field is populated with File Writes from Rule Finder (which shows the information from the Code Search pane). Optionally fill in the Technical Description and Business Description fields. Click OK.

    The Create Rules From List window opens.

  10. Select Business Function from the drop-down list or create New.
  11. Select Rule Set from the drop-down list or create a New one.
  12. The Name template is automatically populated with CHECK IN [FileName] AT [FromRow] AS [Caption]
  13. Enter the Business Description Template (optional).
  14. Enter the Technical Description Template (optional).
  15. If needed, edit the New Attributes.
  16. Click OK. Creating Rules for File Writes. You then get a message telling you the number of rules that have been created.