Search in Files Analysis Tab

Search in files option allows the user to search for specific terms throughout the files of the selected project.

Note: This function is only available for mainframe projects.
Note: VERY IMPORTANT! The search can be performed only if a project was indexed with IBM® AD Batch Server.

In Application Discovery Browser perspective, from the Projects list in the central part of the Explore Projects view, select your project. For details on how to select a perspective and a description of Application Discovery Browser perspective, see AD Perspectives Common Elements.

In the Explore section, to the right of Explore Projects view double-click Search in Files: the Search in files analysis tab is displayed as in the following image.
Figure 1. Search in Files Analysis Tab
Search in Files Analysis Tab

The following search criteria are available in the Filters area:

Term pattern, enter the pattern that you are looking for. Supported patterns include "a* b*", "a*, b*", "a-b", "a b-c-d", "a @", "a #", "a $", "a?b".

Syntax details.
  • "," (comma) means "OR": searching for "termA,termB" shows occurrences (and files) that match any of the terms.
  • " " (space) means consecutive terms: searching for "termA termB" shows only occurrences that match both terms in this exact order. Space or spaces right after comma is(are) ignored and multiple spaces are trimmed - considered as one.
  • "?" (question mark) means any one character: searching for "abc?" shows occurrences of all four character terms where the first 3 characters are "abc".
  • * (asterisk) means any term or any number of characters part of a term. (Because the search is performed on indexed terms and not on full text and a term is considered any sequence of valid characters delimited by separators. For details about which characters are considered as a valid part of a term (and not a separator, and consequently ignored), see https://docs.oracle.com/javase/7/docs/api/java/lang/Character.html#isJavaIdentifierPart(char). To that list the following characters are added: "@","-" and "#". Characters such as "*", "(", ")", "," (comma), ":", "=", and so on are ignored (considered separators).

These search patterns can be combined to search for the wanted terms.

Restrict results to files, enter the names of the files where you want to perform the search.

File type, select the file types where the search is to be performed. Click the adjacent button to display a list of available file types.

Case sensitive, select this option to make the search case sensitive.

Regular expression, select this option to search for regular expressions. If this option is not selected, the field Term pattern can take any text.

Syntax details.
  • "," (comma) means "OR", the same as in the syntax list under Term pattern. ("regEx1,regex2" is equivalent to "regEx1|regex2").
  • " " (space) means consecutive terms, the same as in the syntax list under Term pattern.
Note: When Regular expressions option is checked, regular expression matching is also done for the file name.
Note: In order to obtain a result, the search term (both simple text and regular expression) must fully match an indexed term. In regular expression context, this means that if you use, for example, something like an online regex validator/tester for the regex "term", you match "term" plus any word that contains "term" ("terms", "terminates"). When Search in files function is used with "Regular expression" option selected, searching for "term" shows only occurrences of "term". To obtain the same behavior, you must use a regular expression such as "term\w*".
Ignore comment, use this option to exclude comments from the search results.
Note: The following option is only available for Cobol resources.

Search in results, use this option to perform a search within the results of a previous search operation.

The available projects are listed in the pane to the right of the tab. Select the project where the search is to be performed. Once you selected the wanted criteria, click Search to perform the actual search operation. When the filtering operation is finished, you can use the black arrow button in the upper left corner of Search in files tab to hide the filters and maximize the Results area. The results of the search are displayed in the lower part of the tab and are grouped by project.

Specific analyses can be generated for the files in the Files per project area. Select a file from the list and the available analyses are displayed in the area to the right of Search in files tab. Double-click a file from the Files per project area to open it in the appropriate editor. Also, if you double-click an occurrence in the Occurrences (per file) area the corresponding file is opened in the editor at the line where the searched word was found.

Troubleshooting tip: After running a search in the Search in files analysis, you might run into an error that is displayed as 'HTTP response code: -1'. The error is related to the Java version from the environment.
To fix the error, complete the following steps:
  1. Open the startServer.bat file under the <IBM ADDI Installation Folder>/IBM Application Discovery Search Service/ directory.
  2. Add the -Djdk.io.File.enableADS=true parameter in startServer.bat file.

    Example:

    set javaopts=-Djdk.io.File.enableADS=true -Dsearch.service -Dlog4j2.configurationFile=%log4j%
  3. Restart the service.
If it is still not working, contact the product support.

To export the results of the Search in files operation, use Export results to CSV file in the upper corner of the Results area. The *.CSV file includes all the search criteria used, as well as the number of occurrences per file.