Created On:  13 April 2011

Problem:

Some standard queries within Clipper, or newly written queries, can be very useful to complete analysis within the Executive / Portability Assessment Reports.  It is easy to create new queries or run standard queries interactively, but how can these queries be added to the Executive / Portability Assessment Reports, without the need for Development intervention?

Resolution:

When writing queries within the Modernization Workbench tool, a file called HCSearch.xml, is updated with the query details.  If any queries are written outide of the tool, they must be "imported" into the tool from the Interactive Analysis dialogue, so that the HCSearch.xml file is updated correctly, and then run interactively to validate the results are correct.

For this article, the standard query - Data Queries/Computational Data -  is to be included in the Portability Assessment part of the Executive Report. 

To do this....

1. In the MW-installation/TEMPLATES directory, find the file HCSearch.xml.

2. Search the file and identify the required query - for this example, look for Name="Data Queries" and Name="Computational Data"
   - The statement found would be as follows...

CRITERION Description="This query will find all declarations of computational data items.  Computational data items are numeric only and can be used in arithmetic statements more efficiently." Name="Computational Data" Category="" System="True"

   - This will confirm the existence of the query, and that it will be available to run in the required part of the report.

3. It is recommended that the Common.HCSearch.xml file is NEVER updated manually, as it is updated by configuration of the toos and installation of hot fixes. This will result in any changes being lost. and will mean re-amending the file after each hot fix or configuration change.

4. In the MW-installation/DATA directory, find the file CommonDefects.xml.

5. The query needs to be included after "COMP Declarations" in the "Potential Code Anomalies" section of the Executive/Portability Assessment Report.

6. Search for "COMP Declarations" in the CommonDefects.xml file, which should result in the following statement...
  
      DEFECT id=COMPDeclarations Criterion="General:Portability Assessment\Persistent Storage\Data\COMP Declarations" ListName="COMP Declarations" Caption="COMP Declarations" Group="Data" Enabled="True" Internal="False" /

7. Insert a new line after this as follows...

   DEFECT id=GeneralCompData Criterion="General:Data Queries\Computational Data" ListName="Computational Data" Caption="Computational Data" Group="Data Queries" Enabled="True" Internal="False" /

8. Save the amended file and re-run the Executive / Portability Assessment Report

Incident #2510996