SEARCH directive

Purpose

This directive defines the variable tables that are searched when attempting to assign a variable a value.

Syntax


1  //*%OPC SEARCH  NAME= (
2.1+ .,
2.2.1+ .,
2.2.1 table name
2.2.1! APPL
2.2.1 NOAPPL
2.2.1! GLOBAL
2.2.1 NOGLOBAL
1 )

Parameters

NAME( table name,..., APPL|NOAPPL, GLOBAL|NOGLOBAL )
Identifies the variable tables you want searched, and in what order.

Usage Notes

Use the SEARCH directive to specify the variable tables you want searched. Up to 16 tables, including the application and global tables, can be specified. By default, the variable tables specified using table name are searched first, in the order specified. If HCL Workload Automation for Z does not find a variable in these tables, the application variable table, if it exists, is then searched, followed by the global variable table, if the variable is not found in the application table. A SEARCH directive cannot contain any HCL Workload Automation for Z variables. The following example shows how you can change the search order of the tables using the SEARCH directive.

Example 1

//*%OPC SEARCH NAME=(GLOBAL,TABLE1,NOAPPL)
The search order for variables in JCL containing the SEARCH directive given would be:
  1. GLOBAL
  2. TABLE1
The NOAPPL keyword specifies that the application variable table will not be searched.

Example 2

//*%OPC SEARCH NAME=(TABLE1,TABLE2,TABLE3)
In this example, the search order for variables in a job containing the SEARCH directive given would be:
  1. TABLE1
  2. TABLE2
  3. TABLE3
  4. The application variable table (if it exists)
  5. The global variable table (if it exists)

A SEARCH directive causes all variables in the job before the directive to be resolved. If the SEARCH directive is used more than once, the last specified search order is used to resolve any new variables found. Variables that have already been assigned values retain those values, even if they are found again after a SEARCH or TABLE directive that would have caused a change in their values.