Syntax and options of the OPTIONS control statement
The OPTIONS utility control statement, with its multiple options, defines the function that the utility job performs.
You can create a control statement with the ISPF/PDF edit function. After creating it, save it in a sequential or partitioned data set. When you create the JCL for running the job, use the SYSIN DD statement to specify the name of the data set that contains the utility control statement.
Syntax diagram
Option descriptions
- PREVIEW
- Specifies that the
utility control statements that follow are to run in PREVIEW mode. The utility checks for syntax
errors in all utility control statements, but normal utility execution does not take place. If the
syntax is valid, the utility expands all LISTDEF lists and TEMPLATE DSNs that appear in SYSIN and
prints results to the SYSPRINT data set.
PREVIEW evaluates and expands all LISTDEF statements into an actual list of table spaces or index spaces. It evaluates TEMPLATE DSNs and uses variable substitution for actual data set names when possible. It also expands lists from the SYSLISTD DD and TEMPLATE DSNs from the SYSTEMPL DD that a utility invocation references.
A definitive preview of TEMPLATE DSN values is not always possible. Substitution values for some variables, such as &DATE., &TIME., &SEQ. and &PART., can change at execution time. In some cases, PREVIEW generates approximate data set names. The OPTIONS utility substitutes unknown character variables with the character string "UNKNOWN" and unknown integer variables with zeroes.
Instead of OPTIONS PREVIEW, you can use a JCL PARM to activate preview processing. Although the two functions are identical, use JCL PARM to preview an existing set of utility control statements. Use the OPTION PREVIEW control statement when you invoke Db2 utilities through a stored procedure.
The JCL PARM is specified as the third JCL PARM of DSNUTILB and on the UTPROC variable of DSNUPROC, as shown in the following JCL:
//STEP1 EXEC DSNUPROC,UID='JULTU106.RECOVE1', // UTPROC='PREVIEW',SYSTEM='SSTR'
The PARM value PREVIEW causes the utility control statements in that job step to be processed for preview only. The LISTDEF and TEMPLATE control statements are expanded, but the utility does not execute.
OPTIONS PREVIEW is identical to the PREVIEW JCL parameter, except that you can specify a subsequent OPTIONS statement to turn off the preview for OPTIONS PREVIEW. Absence of the PREVIEW keyword in the OPTION control statement turns off preview processing, but it does not override the PREVIEW JCL parameter, which, if specified, remains in effect for the entire job step.
- LISTDEFDD ddname
-
Specifies the ddname of the LISTDEF definition library. A LISTDEF library
is a data set that contains only LISTDEF utility control statements. This data set is processed only
when a referenced LIST is not found in SYSIN.
The default value is SYSLISTD.
- TEMPLATEDD ddname
-
Specifies the ddname of the TEMPLATE definition library. A TEMPLATE
library is a data set that contains only TEMPLATE utility control statements. This data set is
processed only when a referenced name does not exist in the job step as a DD name and is not found
in SYSIN as a TEMPLATE name.
The default value is SYSTEMPL.
- FILSZ integer
- Specifies a file size in megabytes and overrides the file size for the sort program when sort work data sets are allocated by the utility. Only use this keyword under the direction of IBM® Support.
- EVENT
- Specifies one or more pairs
of utility processing events and the matching action for the event. Not all actions are valid for
all events.
The parentheses and commas in the EVENT operand are currently optional but they may be required in a future release.
- ITEMERROR
-
Specifies how utility processing is to handle errors during list processing. Specifically, this keyword indicates the effect on processing in response to return code 8. By default, utility processing stops (HALT). The ITEMERROR event does not include abnormal terminations (abends).
Note that for the QUIESCE utility, the indexes for the table spaces in the list, if any, are considered as list items for the purposes of the ITEMERROR event. ITEMERROR affects how errors are handled on both the table spaces and the indexes.
- HALT
- Specifies that the utility is to stop after the event.
- SKIP
- Ignores the event and skips
the list item. Processing continues with the next item in the list.
SKIP applies only during the processing of a valid list. SKIP does not apply if a utility detects that a list is not valid for the utility that is invoked. In that case, the list is rejected with an error message and the processing of the list is not initiated.
If any of the items in a list is skipped, the utility produces a return code of 8, which terminates the job step. The following code shows an OPTIONS statement with the SKIP option:
OPTIONS EVENT (ITEMERROR, SKIP) COPY LISTA COPY LISTB
If LISTA contains ten objects and one object produces a return code 8 during the COPY, the other nine objects in the list are copied successfully. The job step ends with a return code 8 and COPY LISTB is not executed.
- WARNING
- Specifies a response to
the return code message event.
Use WARNING to alter the return code for warning messages. You can alter the return code from message DSNU010I with this option. If you alter the message return code, message DSNU1024I is issued to document the new return code.
Action choices are as follows:
- RC0
-
Lowers the final return code of a single
utility invocation that ends in a return code 4 to a return code of 0. Use RC0 to force a return
code of 0 for warning messages.
Use this option only when return code 4 is expected, is acceptable, and other mechanisms are in place to validate the results of a utility execution.
- RC4
- Specifies that return codes for warning messages are to remain unchanged. Use RC4 to override a previous OPTIONS WARNING specification in the same job step.
- RC8
- Raises the final return code of a single utility invocation that ends in a return code 4 to a return code of 8. Use RC8 to force a return code of 8 for warning messages. The return code of 8 causes the job step to terminate and subsequent utility control statements are not executed.
- OFF
- Specifies that all default
options are to be restored. OPTIONS OFF does not override the PREVIEW JCL parameter, which, if
specified, remains in effect for the entire job step. You cannot specify any other OPTIONS keywords
with OPTIONS OFF.
OPTIONS OFF is equivalent to OPTIONS LISTDEFDD SYSLISTD TEMPLATEDD SYSTEMPL EVENT (ITEMERROR, HALT, WARNING, RC4).
- KEY
- Specifies an option that you should use only when you are instructed by IBM Support. OPTIONS KEY is followed by a single operand that IBM Support provides when needed.