$ZROutines Search Examples

This section describes a model for understanding $ZROUTINES operations and the illustrating examples, which may assist you if you wish to examine the topic closely.

You may think of $ZROUTINES as supplying a two dimensional matrix of places to look for files. The matrix has one or more rows. The first row in the matrix contains places to look for object and the second and following rows contain places to look for source. Each column represents the set of places that contain information related to the object modules in the first row of the column.

Example:

    GTM> s $zro="[],[smi.utl]/nosrc,[jon.utl]
    /src=([jon.utl.so],[smi.utl)"
    

The following table illustrates the matrix view of this $ZROUTINES.

$ZROUTINES Search Matrix

SEARCH FOR

Column 1

Column 2

Column 3

OBJECTS

[]

[SMI.UTL]

[JON.UTL]

SOURCE

[]

[JON.UTL.SO]

[SMI.UTL]

To perform object-only searches, GT.M searches only the directories or object libraries in the top 'objects' row for each column starting at column one. If GT.M does not locate the object file in a directory or object library in the 'objects' row of a column, GT.M begins searching again in the next column. If GT.M cannot locate the file in any of the columns, it issues a run-time error.

As illustrated in the preceding table, GT.M searches for object files in the directories [], [SMI.UTL] and [JON.UTL] .

To perform source-only searches, GT.M looks down to the 'source' row at the bottom of each column, excluding columns headed by /NOSRC or object libraries. If GT.M cannot locate the source file in the 'source' row of a column, it searches the next eligible column. The /SRC= qualifier specifies the directories in a column where GT.M should search for the source files related to the object files in the column. If GT.M cannot locate the file in any of the columns, it issues a run-time error.

To perform object-source match searches, GT.M looks at each column starting at column one. GT.M does an object-only search in the 'objects' row of a column and a source-only search in the 'source' row(s) of a column. If GT.M locates either the object file or the source file, the search is done. Otherwise GT.M starts searching the next column. If GT.M cannot locate either the object file or the source file in any of the columns, it issues a run-time error.

As illustrated in the preceding table, GT.M looks for object file in the directory [] and source file in the directory [] first (column one). If neither of them are found, GT.M then looks for object file in [SMI.UTL] (column two). Note that, GT.M does not search for source file since this is a /NOSRC directory. If the object file is not found, GT.M then looks for the object file in [JON.UTL] and source file in [JON.UTL.SO] and [SMI.UTL] as specified by the /SRC=qualifier (column three).

Once the object-source match search is done, GT.M now has either the object-file or source-file or both available. GT.M then recompiles the source-file based on certain conditions, before linking the object-file into the current image. Refer to ZLINK section in the "Commands" chapter of this manual for more information on those conditions.

If auto-ZLINK or ZLINK determines that the source file requires [re]compilation, GT.M places the object file in the above object directory in the same column as the source file. For example, if GT.M locates the source file in [SMI.UTL] in column three, GT.M places the resultant object file in [JON.UTL].