Searching a repository
Searching for Metadata
The Metadata Analyzer has a wealth of information available. This chart shows the entities that it is possible to collect and store in the repository. You can search for any of these entities and for the relationships between them. For example, you can search for all Programs and you can search for all Jobs that use a certain Program.
There are several ways to search for an entity:
- Using the Search dialog box
- Using the Search Relationships wizard
- Using the Advanced Search dialog box
Each of these three primary search methods is designed to accomplish a different task. The Search dialog box is used for the searches you do most often. These are simple searches where you may want to find all programs or data items that meet a certain criteria. The Search Relationships wizard is used to search based on the relationship of one entity to another, such as Programs that use a certain Copybook. The Advanced Search dialog box is used to combine searches. For example if you were searching for Social Security numbers you could use one search for *SSN* and another for *SOC*N*M*. Having both searches in one will provide better results.
You can also search:
- Using the Search Criteria bar
- By reusing a previous search
To re-execute the current search at any time, from the View menu, select Refresh. The Entities view is refreshed to reflect any changes to the database since the search was last performed. Pressing F5 also re-executes the search.
To search using the Search dialog box
The simplest way to search is by using the Search dialog box. This type of search looks for entities that match all of the criteria you enter. Use the Search dialog box to perform searches like these:
- Find all the Data Items named SOCIAL-SECURITY-NUM.
- Find all Datasets that have PROD in their names.
- Find all Programs that haven’t been changed since Jan 1, 2000.
- Find Data Items that have DATE in their names, but you want to exclude UPDATE.
- Find all Data Items named DATE but exclude Literals.
The Search dialog box appears by default when the Metadata Analyzer is started. If it does not, do any of the following:
- Click
.
- Click CTRL+F.
From the Search menu, select Search.
Complete the dialog box as described below. The search below will look for any Data Items with a name that contains WAGES and that have a logical length of 7.
- Click
When you have entered all of the search criteria, click Search. Entities that match the search criteria are shown in the Entities view.
To search using the Search Relationships wizard
The Search Relationships wizard lets you find entities based on their entity criteria and their relationship to other entities, such as Jobs that use a certain Dataset. It allows you to:
- Search for entities types that are related to the entity you are searching for, such as all jobs that use a certain dataset.
- Specify search options, such as whether to include aliases or cross-program analysis in the results.
- Specify output options, such as saving the results in an output file or displaying them in the Entities view.
- Specify whether to run interactively or in batch mode to create report files.
Some other examples of how you could use the Search Relationships wizard are:
- Find all the Jobs and Procs that use a Datasets with PART in their name.
- Find all Programs that use Include CPYBK1.
- Find all Data Items that are Related to Data Item PART-NUM.
- Find all Programs that use a certain DB2 Column.
- From the Search menu or
, select Search Relationships. The Search Relationships wizard appears.
- Complete the dialog box as described below. The search used throughout this example is searching for Programs with a name of CW* that are owned by Payroll and have related Datasets named CW.XC*. This step of the example sets up a search for Datasets named CW.XC*.
This dialog box displays the entities that matched the criteria from the previous step. Select those entities you want to carry on to the next step of the wizard, then click Next. The dialog box columns vary depending on the entity type chosen in the previous step. This step of the example indicates that, of the found entities, I only want to search the Dataset named CW.XC.FILE2.
- This dialog box allows you to select the type of related entities you want to see. This step of the example indicates that I only want to search for Programs that use the previous Dataset.
Use this dialog box to qualify the entities you selected in the previous step. This step allows you to specify that the Programs you are looking for have the name CW* and an owner of Payroll.
Click Search to perform the search. One of the following appears:
- The Search Progress dialog box (when Run in batch and produce report files is not selected)
- A Command Prompt window (when Run in batch and produce report files is selected)
When processing is complete, do one of the following:
- If Run in batch and produce report files was not selected, click OK on the Search Progress dialog box to view the results in the Entities view.
- If Run in batch and produce report files was selected, close the Command Prompt window and open the text files, located in the output location entered in the Search Relationships wizard, to view the results. If dead ends exist for a given entity type combination, they are written to a separate text file.
To use the Advanced Search dialog box
The Advanced Search dialog box allows you to do the following:
- Enter multiple sets of search criteria.
- Use search syntax to build a search.
- Load favorites that contain multiple searches.
- Edit favorites.
Using the Advanced Search dialog box contains a multi-line text box you can use to enter multiple sets of search criteria. It allows you to perform a search such as finding Data Items that describe Customer Numbers using searches for *CST*NUM* and *CST*NM* format.
Other examples of how to use the Advanced Search dialog box include:
- Find Data Items that describe Phone Numbers using searches for Data Items named *PH*NE and *AREA*C*DE*.
- Find Social Security numbers by searching for Data Items with a Name of *SSN* but not *GROSSNET* nor *ASSNMNT* and Data Items with a name having *SOCIAL* but not *SOCIAL-W*RK*. Also DB2 Columns named *SSN* or *SOCIAL*.
From the Search menu or , select Advanced Search. The Advanced Search dialog box appears.
Enter search criteria in any of the following ways:
- Click Add Criteria to open the Search dialog box. Complete the dialog box according to the instructions above.
- Click Load Favorite to open the Select Favorite dialog box so you can select a favorite search to be loaded, edited, or executed.
- Type search criteria directly into the text box using the appropriate search syntax.
When you have entered all of the search criteria, click Search. Entities that match the search criteria are shown in the Entities view.
To use the Search Criteria bar
Any time you set up a search and perform a search, the search criteria is entered into the Search Criteria bar, therefore, the Search Criteria bar always reflects the current search.
You can perform a search by selecting a previous entry from the drop-down history list, or— by learning the syntax used for search criteria— you can type search criteria directly into the Search Criteria bar. After populating the Search Criteria bar, click . Entities that match the search criteria are shown in the Entities view.
To reuse a previous search
There are several ways you can perform a search by reusing a previous search:
- Use the
(back) and
(forward) buttons to locate and run the previous or next search, respectively (if the search was done during the active session).
- Click the Favorites menu to locate and start the search (if you added the search to your Favorites).
- Select from the Search Criteria bar's drop-down history list.