Searching remote z/OS files

Use Remote z/OS File Search to search for content in a remote data set or data set member. Remote z/OS File Search submits a batch ISPF Search-For request (ISPF option 3.14) to a connected remote system and returns search results to the Remote z/OS Search view.

Before you begin

  • Connect to a remote system.
  • To support logging search requests in the audit.log file, the server must be version 9.1 or later.

Procedure

  1. To open the Remote z/OS File Search window:
    • Press Ctrl+I.
    • Select Search > Remote z/OS File from the menu bar.
    • Click Search Search icon on the toolbar, and then click the Remote z/OS File Search tab.
    • In the Remote Systems view or z/OS Projects view, right-click the file or container to search, and then select Search from the menu. Click the Remote z/OS File Search tab.
    • In the COBOL Editor, PL/I Editor, or z Systems® LPEX Editor, highlight a string and press Ctrl+H. Click the Remote z/OS File Search tab.
  2. In the Search string field, type a content string to search for.
    You can use wildcard and escape characters in this field. Valid characters include asterisk (*) to match any string, question mark (?) to match any character, and backslash (\) to specify an escape character for the asterisk, question mark, or backslash characters. To include a single quotation mark in a string, specify two single quotation marks ('').
    You can type a search qualifier to customize the search string. For example,
    
    < : PREFIX
    > : SUFFIX
    < and > : WORD

    When the meta character < is used before a search string, the string will be qualified as PREFIX. When the meta character > is used at the end of a search string, the string will be qualified as SUFFIX. When a search string has both meta characters < and >, the string will be qualified as WORD

    • WORD finds only those occurrences of the search string that are a word. A word is defined as being preceded and followed by a non-alphameric character.
    • PREFIX finds only those occurrences of the search string that are a prefix to a word. A prefix is defined as being preceded by a non-alphameric character and followed by an alphameric character.
    • SUFFIX finds only those occurrences of the search string that are a suffix to a word. A suffix is defined as being preceded by an alphameric character and followed by a non-alphameric character.

    You can also use the separator | for multiple search strings.

  3. Set Search in options to define the scope of a search. You can set the following search scope options:
    • System to choose a remote system to search. This list shows only connected remote systems.
    • Existing filters shows all defined filters for the selected remote system.
    • Data set names to specify one or more data set names to search.
      • Separate multiple data set names with a semicolon (;), as in this example: AAA.BBB.CCC;DDD.EEE.FFF.
      • Separate multiple data set member names with commas (,) as in this example: AAA.BBB.CCC(D,E,F).
      • To search an entire partitioned data set, omit the member name, as in this example: AAA.BBB.CCC.
      • You can use the * and ? wildcard characters to search for member names, as in this example: AAA.BBB.CCC(D*E,FGH?). Support for wildcard characters requires the remote system server to be version 9.1 or later. If the Show member with non-standard names preference for MVS Files is enabled, then the * and ? characters are not treated as wildcard characters.
  4. Optional: You can also specify these search options:
    • Hex search: Select this option to specify a hexadecimal expression as the search string. A hexadecimal search string must contain only pairs of hexadecimal characters (0-9, a-f, and A-F) or wild card characters. For this search string, for example, C6*C5?C4 these search-for statements are generated: SRCHFOR X'C6', SRCHFORC X'C5',+, and SRCHFORC X'C4',+2.
    • Specify column range: Select this option to specify a range of columns to search in the Start column and End column fields. The column range is applied to the first SRCHFOR statement in the generated JCL.
    • Case sensitive: Select this option to find only strings that match the case of the search string.

Results

The client processes a Remote z/OS® File Search as follows:
  1. The client generates a batch ISPF Search-For request and submits it to the remote system. The JOB card generated in the JCL is retrieved from the property group that is associated with the MVS Files subsystem or the default JOB card when no property group is associated.

    The JCL is submitted with the code page of the MVS™ Files subsystem of the target connection. If the code page is IBM®-037 and the search string is $£àé, for example, the last 2 characters are handled as unknown characters. If the code page is IBM-1141 (French), they are converted correctly to $#@{, (that is, 0x5b, 0x7b, 0x7c, 0xc0 in their hexadecimal representation). If the MVS Files subsystem is set to a DBCS code page, the ISPF Search-For request can find the results for a DBCS search string.

  2. When the tracing level for com.ibm.ftt.rse.mvs.client is set to FINEST on the Tracing preference page, the JCL for the command is written to the .trace file.
  3. When the job completes successfully, the client parses the search results and writes them to the SUPERC.OUTDD job data set.
  4. After parsing a successful result, the client purges the job. If the return code is greater than 1, the job is not purged. If the tracing level for com.ibm.ftt.rse.mvs.client is set to FINEST, the job ID, return code, and purge status are written to the .trace file.
  5. If the job fails, the client submits a next JCL if it exists. The client displays a warning message that lists the job IDs of any failed requests.
  6. The search results are displayed in the Remote z/OS Search results view using the same format as Remote z/OS Search. The result view is updated after parsing the JCL output for each data set. When the search request generates a large number of search results, the client might take longer to download and parse the results. You can use the Add Query menu item to save the search query to the My Favorites folder of the MVS Files subsystem.
When the server is version 9.1 or later, the server adds these entries to the audit.log file:
  • Before submitting the JCL: <user_id>,SEARCH_FILE,<search_dataset_name>,<search_query_string>
  • After the job completes: <user_id>,SEARCH_FILE,<search_dataset_name>,<search_query_string>,<return_code>

Example

The following screen capture and sample code show a search query and the JCL that is generated. For more information about the ISPF Search-For utility and examples of ISPF Search-For query strings, see the ISPF User's Guide, Volume II.
Sample Remote z/OS File Search query

//USERID1 JOB ,
// MSGCLASS=H,MSGLEVEL=(1,1),TIME=(,4),REGION=144M,COND=(16,LT)
//SUPERC   EXEC PGM=ISRSUPC, 
//             PARM=('SRCHCMP,NOSEQ,ALLMEMS,ANYC') 
//OUTDD   DD SYSOUT=* 
//NEWDD    DD DISP=SHR,DSN=USERID.TEST
//SYSIN    DD * 
SRCHFOR 'A' 
SRCHFORC 'B',+ 
SRCHFORC 'C''D',+2
SRCHFOR 'EF G',W  
SELECT MEMBER1,MEMBER2,MEMBER3 
/* 
//