Previous Topic Next topic Print topic


OPTION

Enables non-default optional behavior.
Attention: Starting with Enterprise Developer 2.2 Update 1, OPTION is supported for backward compatibility, but is deprecated. Use equivalent SQL or HCOSS SQL compiler directive options instead.

Syntax:

OPTION={[NO]RSLOCATORS |  CHECKCALLPARAMS | SQLCLRTRANS | SPCOMMITONRETURN | 
[NO]IGNORESCHEMAERRORS | NESTEDCLRDEBUG | PROCOB | [NO]SPDISPLAY | 
[DESCRIBEVARCHARPICX | DESCRIBEVARCHAR49] | [DESCRIBEDTREC | DESCRIBEDTCHAR] | 
OPTIMIZESPCURSORS}...

Parameters:

RSLOCATORS
HCOSS only and for .NET applications only. Enables non-COBOL client applications to read result sets from COBOL stored procedures that have been migrated from the mainframe and that use SQL(DIALECT=MAINFRAME). Cursors declared as WITH RETURN TO CALLER return default SQL Server result sets rather than simulated mainframe result set locators. Default is RSLOCATORS. To use RSLOCATORS, you must set DBMAN=ADO.
CHECKCALLPARAMS
HCOSS only. Evaluates the parameters on a stored procedure call to determine if they are input or output. Automatically set by DIALECT=MAINFRAME.
SQLCLRTRANS
HCOSS only. Emulates mainframe behavior by substituting SQL Server savepoint operations for COMMIT and ROLLBACK when building both client applications and stored procedures. Uncommited work is rolled back when a stored procedure returns to the calling application unless the stored procedure was built with SPCOMMITONRETURN. Database locks are not released until the calling application performs a COMMIT or a ROLLBACK.
Note: If the client application is written in a language other than COBOL or PL/I, then it should also execute the SQL Server statement save transaction MF__SAVEPOINT at the start of every transaction (i.e., after every COMMIT or ROLLBACK statement) and when turning AUTOCOMMIT mode off.
SPCOMMITONRETURN
HCOSS only. Commits work done by a stored procedure when it returns to the calling application.
IGNORESCHEMAERRORS
HCOSS only. When SQL(CHECK) is also specified, suppresses compile time errors resulting from missing schema objects. In this mode, you can use OpenESQL to check for SQL syntax errors without reference to the database schema. This can be helpful when planning an application migration, as you can use the COBOL compiler and OpenESQL to identify the statements that require remediation without having to first migrate the database schema. It also provides enhanced OpenESQL syntax checking during the development phase. Default is NOIGNORESCHEMAERRORS.
NESTEDCLRDEBUG
Enables debugging of nested stored procedure calls. Without this parameter, it is not possible to debug stored procedures that return result sets. This is due to limitations in the Microsoft SQL Common Language Runtime. NESTEDCLRDEBUG instructs the preprocessor to discard any result sets returned from nested stored procedure calls, thus making debugging possible.
PROCOB
Sets the DATE SQL compiler directive option to EXTERNAL for .NET applications only, that is, when DBMAN=ADO.
SPDISPLAY
Determines where COBOL DISPLAY information can be accessed. When set for a SQL CLR stored procedure, COBOL DISPLAYs are sent back to the caller as SQL Server information messages. When set for a COBOL application, SQL Server information messages are written to the console. When a COBOL stored procedure is called using an interactive SQL tool, such as SQL Server Management Studio, information messages are shown via the message output provided by the tool.

SPDISPLAY can be useful for tracing during debugging and for logging in deployed applications. If not set, then COBOL DISPLAY statements have no effect. Default is NOSPDISPLAY.

DESCRIBEVARCHARPICX
VARCHAR columns are suitable for PIC X host variables. Default.
DESCRIBEVARCHAR49
VARCHAR columns are suitable for VARCHAR host variables with level 49 sub-fields for length and data. For HCOSS only, automatically set by DIALECT=MAINFRAME.
DESCRIBEDTREC
DATE, TIME, and DATETIME columns are suitable for the DATE, TIME, and TIMESTAMP-RECORD SQL TYPEs in ODBC format record structures. Default.
DESCRIBEDTCHAR
DATE, TIME, and DATETIME columns are suitable for PIC X(n) character host variables or DATE, TIME, and TIMESTAMP SQL TYPEs. For HCOSS only, automatically set by DIALECT=MAINFRAME.
OPTIMIZESPCURSORS
For SQL CLR stored procedures, opens forward read-only cursors as firehose cursors, and when subsequent cursors are opened, reads the remainder of the result set into memory to optimize performance.

Properties:

Default: None

Dependencies:

For HCOSS only, BEHAVIOR=OPTIMIZED automatically sets DESCRIBEDTCHAR.

DIALECT=MAINFRAME automatically sets CHECKCALLPARAMS, DESCRIBEVARCHAR49, and DESCRIBEDTCHAR.

Scope:

Used at compile time: Yes
Behavior at run time: Source file

See Scope - OpenESQL SQL Compiler Directive Options and Scope - HCOSS SQL Compiler Directive Options for more information.

Comment:

Separate each instance of OPTION with a space.

Examples:

SQL(OPTION=DESCRIBEVARCHARPIX OPTION=NESTEDCLRDEBUG)
SQL(OPTION=DESCRIBEVARCHARPIX OPTION=IGNORESCHEMAERRORS OPTION=OPTIMIZESPCURSORS OPTION=PROCOB)
Previous Topic Next topic Print topic