SEARCH directive
Purpose
This directive defines the variable tables that are searched when attempting to assign a variable a value.
Syntax
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)
GLOBAL
TABLE1
Example 2
//*%OPC SEARCH NAME=(TABLE1,TABLE2,TABLE3)
TABLE1
TABLE2
TABLE3
- The application variable table (if it exists)
- 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.