Searching a remote z/OS system
You can search a z/OS® system for file names or for files that contain a search string.
Before you begin
Connect to a remote system.
The search function can return search results incrementally so that you can begin working with search results before all results are returned. This function is controlled by a setting in the Remote z/OS Search preference page. To open this page, click Preferences at the bottom of the Remote z/OS Search window. For more information about controlling how frequently search results are updated, see Setting preferences for Remote z/OS Search.
About this task
To search for strings in a specific data set or data set member, you can also use the Remote z/OS File Search window. This window generates a batch ISPF search-for request (ISPF option 3.14) and can be a more efficient way to search in large data sets. For more information about the Remote z/OS File Search window, see Searching remote z/OS files.
- The options in the Search for area
- The With name field
- The Content strings field
- The Regular expression check boxes in the Search for area
- Settings in the Search result options area
- Settings in the Content string options area
- The setting of the Search Options push button (expanded or collapsed)
Procedure
To search for a file or for file content on a z/OS system:
Results
- If you type a string in the With name field and leave the Content strings field empty, then the search returns a list of data set or member names as the search result.
- If you type a string in the Content strings field, then the search returns a list of content strings as the search result.
Constructing an AND search query
Example
- Open the Remote z/OS Search window.
- In the Content strings field, type a search
string with the following syntax:
To find all lines in a program that contain the strings.*<literal1>.+<literal2>
IF
andWS-PHARM
, for example, type the following search string:.*IF.+WS-PHARM
Including the ? character in a content string search
Example
You can include the ? wildcard character in the Content string field of the search window. This character returns different results with the Regular expression option on (selected) or off (cleared).
Field name | Regular expression option | Use to search for | Sample search string | Matching results |
---|---|---|---|---|
Content string | On | Search for a character that occurs once or not at all in the position preceding the ? wildcard character. | VARA?B | The search in a COBOL program that contains
the following variable declarations:
|
Content string | Off | Search for any single character in the position of the ? wildcard character. | VARA?B | The search in a COBOL program that contains
the following variable declarations:
|
Constructing a regular expression search
Example
- With name
- A regular expression search in the With name field
calls the regular expression engine searching for exact matches. The
search scope for this type of search is member names (that is, you
cannot use it to search data set names). The following two examples
illustrate how a regular expression search functions with this list
of member names:
- COBOLTST
- CBLTST
- ACOBTST
- The search pattern COB returns no results because no member name is exactly COB.
- The search pattern *COB* returns all member names except CBLTST.
- Content string
- A regular expression search in the Content string field
calls the regular expression engine searching for any match of the
search string in the content of members. Given the same list of member
names, the following regular expression searches in the Content
string field return these results:
- The search pattern COB returns all member names except CBLTST because the search engine is looking for any instance of COB.
- The search pattern *COB* also returns all member names except CBLTST.