Exporting search results

You can export z/OSĀ® search results to a text file, which you can then import into a spreadsheet program.

Before you begin

You must be connected to a remote system and complete a Remote z/OS Search operation that populates the Remote z/OS Search results view.

About this task

The export operation exports the contents of the Remote z/OS Search view. If you click the export icon before the search results view is fully populated, then not all search results are included in the export file. To ensure that you export all search results, wait until the view is fully populated before you click the export icon.
Restriction: The search result export wizard places some restrictions on the content you can export. If the Remote z/OS Search view contains a list of partitioned data sets and data set members, then you can export only the file information about the partitioned data sets. You cannot export file information about the data set members. If you select data set members in the Remote z/OS Search view and click the export icon, a warning message is displayed.

Exporting all results

Procedure

  1. In the Remote z/OS Search results view, click Export to file Export to file.
    The Export Search Results window opens. In the Results to include section, All results is selected by default.
  2. In the Destination section, type a path name for the export file or click Browse to select a location.
    You can save the export file to a local or remote location. The output file is a text-format file. You can use any file name extension, such as .txt or .csv.
  3. Optional: In the Data to export section, choose data selection options.
    If you accept the defaults for data selection and formatting, the wizard generates an export file with the following data and format:
    • File information only: Only file information is exported.
    • File information and content strings: Both file information and content strings are exported. If the search results do not include content strings, only file information is exported. This option is selected by default.
    • File information, content strings, and preview lines: File information is exported with preview lines and matched content strings. This option is disabled when the search type is dataset or member name search.
  4. Optional: In the Data formatting options, choose data formatting options.
    • Key and value: The exported file contains only keys and matched values from each result.
    • Header and data: The exported file contains one line that lists the field labels and one line of data for each result.
    • Data only: The exported file contains only data from each result.
    For more information about selecting other data and formatting options, see Formatting an export file.
  5. Optional: Choose CSV file format options section.
    • File encoding: Select UTF-16LE or UTF-8. UTF-8 is selected by default.
    • Delimiter: Tab is selected by default.
  6. Optional: Surround fields with quotes ("): Select this option to surround each output field with quotation marks.
  7. To export the search results, click Finish.
    You can click Restore Defaults to restore the default settings.

Exporting selected results

Procedure

  1. In the Remote z/OS Search results view, select one or more rows.
    For search results that contain content strings, you can select file results or content string results, or both. For search results that contain partitioned data sets and data set members, you can export file information for the partitioned data sets only. If you select data set members, a warning message is displayed.
  2. Click Export to file Export to file.
    The Export Search Results window opens.
  3. Click Selected results only.
  4. Optional: In the Data to export section, choose data selection options.
    If you accept the defaults for data selection and formatting, the wizard generates an export file with the following data and format:
    • File information only: Only file information is exported.
    • File information and content strings: Both file information and content strings are exported. If the search results do not include content strings, only file information is exported. This option is selected by default.
    • File information, content strings, and preview lines: File information is exported with preview lines and matched content strings. This option is disabled when the search type is dataset or member name search.
  5. To export the search results, click Finish.
    You can click Restore Defaults to restore the default settings.

Formatting an export file

Procedure

To change the default data selection and format options for a search result export file:

  1. Choose the search result data to export:
    • File information only exports only information about data sets or data set members in the search results.
    • File information and content strings exports information about data sets and data members and the content strings in the search results. This option is available only if the search results contain content strings.
    The following image illustrates file information and content strings in search results:
    File information and content strings in search results
  2. Choose how to format the exported search results:
    • Key and value: Each line in the export file contains a key and a value for each data field. Specify a separator in the Separator field. If you choose this format and specify a colon as the separator, then the data fields are saved in the format key:value.
      File name:HLQ.SOURCE.COBOL/MYFILE.cbl Extension:cbl Lock owner:userid
      File name:HLQ.SOURCE.PLI/YOURFILE.pli Extension:pli Lock owner:userid2
      File name:HLQ.SOURCE.COBOL/FILE3.cbl Extension:cbl Lock owner:null
      Tip: The label for the key is specified on the next page of the wizard. You can use the default labels or create your own labels.
    • Header and data: The export file contains one line that lists the field labels and one line of data for each result. If you choose this format and select the Surround fields with quotes option, the export file is formatted like this example:
      "File name" "Extension" "Lock owner"
      "HLQ.SOURCE.COBOL/MYFILE.cbl" "cbl" "userid1"
      "HLQ.SOURCE.PLI/YOURFILE.pli" "pli" "userid2"
      "HLQ.SOURCE.COBOL/FILE3.cbl" "cbl" ""
      
    • Data only: The export file contains only data values and no field labels. If you choose this format and select the Surround fields with quotes option, the export file is formatted like this example:
      "HLQ.SOURCE.COBOL/MYFILE.cbl" "cbl" "userid1"
      "HLQ.SOURCE.PLI/YOURFILE.pli" "pli" "userid2"
      "HLQ.SOURCE.COBOL/FILE3.cbl" "cbl" ""
      
  3. Choose how to format the export file:
    • File encoding: Select UTF-16LE or UTF-8.
    • Delimiter: Select a character to use as a delimiter between fields in the export file: caret, colon, comma, semicolon, space, or tab.
    • Surround fields with quotes ("): Select this option to surround each output field with quotation marks. This option is not available if you choose the Key and value data format option.
  4. To choose the data fields to include in the export file or to change the field labels, click Next.
    1. On the Select Fields to Export page, select the fields to include in the export file, or clear fields to exclude them.
      The Line number and Line text fields are available only when the search results include content strings.
    2. To change the field labels that are used for the Key and value and Header and data file format options, type a label in the Label field.
      If you choose the Data only file format, then the Label fields are disabled.

Results

The following example illustrates an export file that contains file information with default data selection and export file format options. The first row is the header row and the remaining three rows contain search result data.
"File name" "Extension" "Lock owner"
"HLQ.SOURCE.COBOL/MYFILE.cbl" "cbl" "userid1"
"HLQ.SOURCE.PLI/YOURFILE.pli" "pli" "userid2"
"HLQ.SOURCE.COBOL/FILE3.cbl" "cbl" ""
The following example illustrates an export file that contains content strings with default data selection and export file format options. The first row is the header row and the remaining three rows contain search result data.
"Name"	"Extension"	"Transfer" "Line" "Text"
"USER33.ZUNIT.PLI/PLITC001.pli"	"pli"	"text"	"7"	"| Component: IBM ZUnit (z/OS Automated Unit Testing Framework)    |"
"USER33.ZUNIT.PLI/PLITC001.pli"	"pli"	"text"	"9"	"| File: Enterprise PL/I ZUnit Test Case                           |"
The following example illustrates an export file that contains file information, content strings, and preview lines.
"Name" "Extension" "Line" "Text"
"HLQ.SOURCE.COBOL/FILE4.cbl" "cbl" "text" "50" "500   ---MATCHED CONTENT STRING LINE---                                   "
# 470   ---LINE BEFORE THE MATCHED LINE---                                 
# 480   ---LINE BEFORE THE MATCHED LINE---                                 
# 490   ---LINE BEFORE THE MATCHED LINE---                                 
#> 500   ---MATCHED CONTENT STRING LINE---                                  
# 510   ---LINE AFTER THE MATCHED LINE---                                  
# 520   ---LINE AFTER THE MATCHED LINE---                                  
# 530   ---LINE AFTER THE MATCHED LINE---