Searching for text strings on the IBM i server

About this task

You can search for text strings on your Native IBM® i file system in the Remote System Explorer. See Searching for text and files on remote servers for information on searching Linux, UNIX, Windows systems, as well as the IBM i IFS.

This action corresponds to the FNDSTRPDM command in PDM, which would search for strings in a member or file. The option in the Remote System Explorer searches libraries as well as members and files. You can search the Native IBM i file system from the Remote Systems view or from the populated Object Table view, depending on your preference. After the search completes, you can perform actions against the items listed with the pop-up menu.

This option is flexible in that you can select multiple items, which can be of the same or of different types. For example, you can select a source member from one library, and then a physical file from another library, and search for the same string. You can also select a filter, and a library, and then search them simultaneously.

There are two ways to search: from a selection, or from the entire IBM i server. When you search from a selection, you navigate through your libraries and files until you find the item you want to search. When you search from the entire IBM i server, you do not begin with any selection or containing item. Your search is as broad as you want, and you can narrow the search by specifying certain libraries, files, or member names to search in the dialog box.

Attention: You can only search IBM i libraries and files to which you have read or browse access. Contact your IBM i system administrator if you need to obtain read access to libraries that you do not own.

To search for strings from a selection:

  1. In the Remote Systems view, expand your IBM i connection and then expand Objects until you reach the item that you want to search. Or, navigate through items displayed in the Object Table view. Select the containing item by clicking on the item.
  2. Right-click and select Find string.
  3. In the Find String window, specify the string that you want to search in the Search string field. The string can be character or hexadecimal.
  4. Select the Case sensitive check box if applicable.
  5. The Scope area displays the targets that you have selected. If you are searching libraries or library filters, two check boxes beneath this area are enabled: Source members and Data members. Source members is checked by default. Check Data members if you want you also want to search data members. (A data member search takes longer, compared to only a source member search, which is why it is unchecked by default.)
  6. If applicable, specify columns to search with the Columns radio buttons. By default, all columns are searched.
  7. Click OK.
To search for strings from the entire IBM i server:
  1. Click Search > IBM i from the workbench menu.
  2. In the IBM i Search tab of the Search window, specify the string that you want to search in the Search string field. The string can be character or hexadecimal.
  3. Select the Case sensitive check box if applicable.
  4. Note that your IBM i connection is automatically filled in.
  5. Use the Target area to specify the target that you want to search. The names can be generic.
    • Enter values or an asterisk (*) in the Library, File, and Member fields, or click Browse to navigate to these items.
    • If the file name is generic, two check boxes beneath this area are enabled: Source members and Data members. Source members is checked by default. Check Data members if you want you also want to search data members. (A data member search takes longer, compared to only a source member search, which is why it is unchecked by default.)
  6. If applicable, specify columns to search with the Columns radio buttons. By default, all columns are searched.
  7. Click OK.
The matching strings display in the Remote Search view. The view shows the strings and/or files that you searched for, with the matches listed beneath in a tree-view structure. For example, if you searched the file for the string, "disk" in a number of files, then the Remote Search results view might look like this (with the pop-up menu activated):

To manipulate the set of search results:
  • Right-click the parent items of the tree, in this example, "RSELABXX/QRPGLESRC(PAYROLL)", and select any of the regular Remote Systems options, for example, Open With, PDM Options, Properties, and so on.
  • Right-click any line beneath the parent search item in the tree, in this example, "(Line 32) FEMPMST UF A E KDISK":
    • Select Open with to lock and open the member in an editor.
    • Select Browse with to open the member in an editor without locking the member on the server.
  • Double-click the parent or line item to open the member and have the cursor positioned to the line found.

Feedback