SEARCH | NOSEARCH

Category

Compiler input

Pragma equivalent

None.

Purpose

Specifies the directories or data sets to be searched for system include files.

When the SEARCH compiler option is in effect, the preprocessor looks for system include files in the specified directories or data sets. System include files are those files that are associated with the #include <filename> form of the #include preprocessor directive. See Using include files for a description of the #include preprocessor directive.

When the NOSEARCH compiler option is in effect, the preprocessor searches only those data sets that are specified in the SYSLIB statement.

Syntax

Read syntax diagramSkip visual syntax diagram
            .-,-----------.        
            V             |        
   .-SE--(----+----+--opt-+--)-.   
   |          '-//-'           |   
>>-+-NOSE----------------------+-------------------------------><

Defaults

For C++, the default option is SE(//'CEE.SCEEH.+', //'CBC.SCLBH.+'). For C, the default option is SE(//'CEE.SCEEH.+').

Note: The c99, c89, cc, and c++ utilities explicitly specify this option in the z/OS® UNIX System Services shell. The suboptions are determined by the following:
  • Additional include search directories identified by the c89 -I options. Refer to c89 — Compiler invocation using host environment variables for more information.
  • z/OS UNIX environment variable settings: prefix_INCDIRS, prefix_INCLIBS, and prefix_CSYSLIB. They are normally set during compiler installation to reflect the compiler and runtime include libraries. Refer to Environment variables for more information.
This option is specified as NOSEARCH, SEARCH by the c89 utility, so it resets the SEARCH parameters you specify. While the c89 utility forces NOSEARCH so that any defaults that are set by the customizable defaults module CCNEDFLT are cleared, the xlc utility relies on the entry in the configuration file for that purpose. If you do not specify -qnosearch in the configuration file, xlc will append the search libraries specified via the -I flags to the libraries set by the CCNEDFLT customizable defaults module. This essentially allows xlc users to take advantage of the customization module, which is not the case with the c89 utility.

Parameters

The suboptions for the SEARCH option are identical to those for the LSEARCH option. For information on the LSEARCH option, see LSEARCH | NOLSEARCH.

Usage

The SYSLIB ddname is considered the last suboption for SEARCH, so that specifying SEARCH (X) is equivalent to specifying SEARCH(X,DD:SYSLIB).

Any NOSEARCH option cancels all previous SEARCH specifications, and any new SEARCH options that follow it are used. When more than one SEARCH compile option is specified, all directories or data sets in the SEARCH options are used to find the system include files.

Notes:
  1. SEARCH allows the compiler to distinguish between header files that have the same name but reside in different data sets. If NOSEARCH is in effect, the compiler searches for header files only in the data sets concatenated under the SYSLIB DD statement. As the compiler includes the header files, it uses the first file it finds, which may not be the correct one. Thus the build may encounter unpredictable errors in the subsequent link-edit or bind, or may result in a malfunctioning application.
  2. If the filename in the #include directive is in absolute form, searching is not performed. See Determining whether the file name is in absolute form for more details on absolute #include filename.

IPA effects

The SEARCH option is used for source code searching, and has the same effect on an IPA compile step as it does on a regular compilation.

The IPA link step accepts the SEARCH option, but ignores it.

Predefined macros

None.

Related information

For further information on library search sequences, see Search sequences for include files.