option | A string constant specifying the name of the option to set. |
value | The value to set for the option. |
The #WORKUNIT statement sets the option to the specified value for the current workunit. This statement may be used outside an XML scope and does not require a previous call to the LOADXML function to instantiate an XML scope.
Valid option settings are:
cluster | The value parameter is a string constant containing the name of the target cluster on which the workunit executes. |
protect | The value parameter specifies true to indicate the workunit is protected from deletion, or false if not. |
name | The value parameter is a string constant specifying the workunit's jobname. |
priority | The value parameter is a string constant containing low, normal, or high to indicate the workunit's execution priority level, or an integer constant value (not a string) to specify how far above high the priority should be ("super-high"). |
scope | The value parameter is a string constant containing the scope value to use to override the workunit's default scope (the user ID of the submitting person). This is a Workunit Security feature and requires a system which is LDAP-enabled. |
Example:
#WORKUNIT('cluster','400way'); //run the job on the 400-way target cluster
#WORKUNIT('protect',true); //disallow deletion or archiving by Sasha
#WORKUNIT('name','My Job'); //name it "My Job"
#WORKUNIT('priority','high'); //run before other lower-priority jobs
#WORKUNIT('priority',10); //run before other high-priority jobs
#WORKUNIT('scope','NewVal'); //override the default scope (on an LDAP enabled system)