Exporting search results

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

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.
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

  1. In the Remote z/OS Search results view, click Export to file Export to file.
    The Export Search Results window opens. The All results option is selected by default.
  2. In the Location field, 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: Choose data selection and formatting 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 and content strings: If the search results do not include content strings, then only file information is exported.
    • Header and data: The export file contains one line that lists the field labels and one line of data for each result.
    • File encoding: UTF-16LE.
    • Delimiter: Tab.
    • Surround fields with quotes ("): Surrounds each output field with quotation marks.
    For more information about selecting other data and formatting options, see Formatting an export file.
  4. To export the search results, click Finish.

Exporting selected results

  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: Choose data selection and formatting 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 and content strings: If the search results do not include content strings, then only file information is exported.
    • Header and data: The export file contains one line that lists the field labels and one line of data for each result.
    • File encoding: UTF-16LE.
    • Delimiter: Tab.
    • Surround fields with quotes ("): Surrounds each output field with quotation marks.
    For more information about selecting other data and formatting options, see Formatting an export file.
  5. To export the search results, click Finish.

Formatting an export file

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.
  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.
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 z/OS Automated Unit Testing Framework (zUnit)    |"
"USER33.ZUNIT.PLI/PLITC001.pli"	"pli"	"text"	"9"	"| File: Enterprise PL/I zUnit Test Case                           |"
1 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.