Searching a remote z/OS system

You can search a z/OS® system for file names or for files that contain a search string.

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.

The Remote z/OS Search window provides various options for searching z/OS systems. The following procedure provides basic search instructions. For more information about the various search options, see Setting other search options.
Tip: The Remote z/OS Search window retains the following search options that are used for a previous search, if you do not select a different object for the search:
  • The options in the Search for area
  • The With name field
  • The Content strings field
If you select a new object for a search, the search function prepares a new search and clears these options.
The following search options are always retained:
  • 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)

To search for a file or for file content on a z/OS system:

  1. To open the Remote z/OS Search window:1
    • Click Search Search icon on the toolbar.
    • Press Ctrl+H.
    • Select Search > Search from the menu bar.
    • In the Remote Systems view, right-click the file or container to search, and then select Search from the menu.
  2. Click the Remote z/OS Search tab.
    Remote z/OS Search is the default search view when you initiate a search from these views or editors:2
    • Remote Systems view
    • Remote System Details view
    • JCL Editor
  3. Choose the type of file you are searching for:
    • Data set member: Select this option to search for a data set member.
    • Sequential data set: Select this option to search for a sequential data set, VSAM data set, or generation data set.
    • Partitioned data set: Select this option to search for a partitioned data set or generation data group.
  4. Optional: In the With name field, type the file name to search for.
    This field is optional when you are searching for file contents rather than a file name. If the Regular expression check box is not selected, you can use wildcard characters in the With name field. Valid characters include * to match any string and ? to match a single character. Wildcard characters are not allowed in a high-level qualifier.
    Important: To use the ? wildcard character, both the client and server must be version 3.0 or later. For examples of using the ? wildcard character, see Including the ? character in a content string search
  5. Optional: In the Content strings field, type the text to search for.
    To search for a file name, leave this field blank (or type * in the field). To search within a file, you must specify a content string in this field. You can use wildcard and escape characters in the Content strings field. Valid characters include * to match any string, ? to match any character, and \ to specify an escape character for these literals: * ? or \. For an example of constructing an AND search query, see Constructing an AND search query.
    Note: The Content strings field is not available for Partitioned data set searches.
  6. Optional: Select the Regular expression check box to enter a regular expression for the With name or Content strings field.
    You can use the \xhh escape sequence in the Content strings field to search for hexadecimal content in a remote z/OS file. For more information about searching for hexadecimal content, see the related topics. For the meaning of * and ? in regular expressions, see Class Pattern. For examples of constructing a regular expression search, see Constructing a regular expression search.
  7. Click Search.
The search window closes and the Remote z/OS Search view opens, listing the search results. A search can return two types of 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.
You can double-click files that are listed in this view to open them in the editor. If you request a search for content strings within files, you can expand the files that are listed in this view by clicking + next to their names. The lines that match the specified search string are listed beneath these files. You can double-click a line number to open the corresponding file and position the cursor at that line. For more information about working with search results, see Working with search results.

Constructing an AND search query

Including the ? character in a content string search

Constructing a regular expression search

1 For IDz users, you can also open the Remote z/OS Search window in one of the following ways:
  • In the z/OS Projects view, right-click the file or container to search, and then select Search from the menu.
  • In the COBOL Editor, PL/I Editor, or z Systems® LPEX Editor, highlight a string and press Ctrl+H.
2 For IDz users, you can also initiate a search from z/OS Projects view, COBOL Editor, PL/I Editor and z Systems LPEX Editor.
3 For IDz users, search for Working with search results in IDz KC.
4 For IDz users, if you know the content of a data set or member and a full or partial file name, you can also use Remote z/OS File Search. For more information, search for Searching remote z/OS files in IDz KC.
5 For IDz users, search for Working with search results in IDz KC.