How is the Change Analyzer affected code report now run in batch mode?
The affected code report can be called via the batch interface for Enterprise Analyzer, what are the parameters for the call?
As part of the change analyzer process, it is possible to run a report called the affected code report. This will show all the lines of code for the data items that have been found by the change analyzer clipper query, that was used to populate the relevant list. The creation of the list and running the report can either be done from the Enterprise Analyzer (EA) GUI, from the change analyzer menu option, or via a batch script using the brave command.
The advantage of the brave interface is that the report can be run in batch mode, so it can be included in the Batch Refresh Process (BRP) in one of the user exits. It can also be run independently of BRP in its own batch script.
When it is run via the brave interface, it can also run the clipper query to create the list and then run the affected code report against that list. The parameters to the script will control the workspace that is used, the query to be run to build the list, the name of the list to be used, how the items are added to the list and the location of the output file. A number of parameters can be defaulted, but some things cannot be changed like the name of the project that the query is run against and the name of the output report.
As this is a batch script that uses the brave interface, it uses the standard brave interface of:
<EA Install dir>\bin\brave <EA Install dir>\Scripts\BRP\AffectedCodeReport.bj <log file> Workspace=<workspace rwp file> <extra script parameters>
<EA Install dir> - directory that EA is installed into, normally this is C:\Program Files (x86)\Micro Focus\Enterprise Analyzer
<EA Install dir>\bin\brave – fully qualified name of the brave executable
<EA Install dir>\Scripts\BRP\AffectedCodeReport.bj - fully qualified name of the AffectedCodeReport batch script
<log file> - fully qualified name of the log file that will be created by brave to show the success or failure of the AffectedCodeReport.bj script
Workspace=<workspace rwp file> - fully qualified name of the workspace rwp file that is used to connect to the workspace that the affected code report is to be run against.
<extra script parameters> - the list of parameters that are to be passed to the AffectedCodeReport.bj script, excluding the workspace name.
Model - name of Model, this must be in the correct case. Examples include COBOL and PLI.
SearchPattern - the AffectedCodeReport.bj script does not use this parameter
CriterionName - Search Criterion name. This is case sensitive and needs to be full name of the query to be run including the folder(s) it has been created in.
Accumulate - set to either true or false. The default is true.
ListName - name of the list to hold the results of the query. The default value is [WS.User].Change Analyzer.Working.
aCategoryName - name of category that the list is saved under. For now it is "Change Analyzer" only
outPutPath - the output Directory, if left blank the report will be saved to Workspace\Output directory.
- Please refer to the on-line help system chapter Supported Features by Language, specifically the Source-Level Analysis to check that the model type in question can be used in clipper queries. Only certain model types, like COBOL and PLI support Interactive Analysis which is required to be able to run clipper queries.
- The report is always called AffectedCode.htm and is always produced in html format.
- The query is run against the last project that was opened in named workspace.
- Only queries that have been created under the Change Analyzer folder can be used. The query is expected to find variables and the lines within a source module where the variables are referenced. User defined change analyzer queries can be run.
- If the name of list, query etc can contain spaces, then the parameters needs to be enclosed in quotes.
Example command lines are:
"C:\Program Files (x86)\Micro Focus\Enterprise Analyzer\Scripts\BRP\AffectedCodeReport.bj" c:\logs\affected.log Workspace=c:\QA\auto.rwp Model=COBOL "CriterionName=Change Analyzer:Date Candidates"
"C:\Program Files (x86)\Micro Focus\Enterprise Analyzer\Scripts\BRP\AffectedCodeReport.bj" "E:\asb_work_area\ PoC\Impact_Analysis\Run_Affected_Report.log" "Workspace=E:\EA_Workspaces\Upgrade_Test.rwp" "Model=COBOL" "CriterionName=Change Analyzer:Name Like Program" "Accumulate=false" "outPutPath=E:\asb_work_area\PoC\ Impact_Analysis"
Incident # 2685546