SET CURRENT APPLICATION COMPATIBILITY statement

The SET CURRENT APPLICATION COMPATIBILITY statement assigns a value to the CURRENT APPLICATION COMPATIBILITY special register. This special register allows users to control the package compatibility level behavior for dynamic SQL.

Invocation for SET CURRENT APPLICATION COMPATIBILITY

This statement can be embedded in an application program or dynamically prepared.

Authorization for SET CURRENT APPLICATION COMPATIBILITY

None required.

Syntax for SET CURRENT APPLICATION COMPATIBILITY

Read syntax diagramSkip visual syntax diagramSETCURRENT APPLICATION COMPATIBILITYCURRENT APPLCOMPAT=string-constantvariable

Description for SET CURRENT APPLICATION COMPATIBILITY

string-constant
Specifies a character string constant. The value must represent a valid release compatibility level, in uppercase.
variable
A variable with a data type of CHAR or VARCHAR. The value of variable must not be null and must represent a valid release compatibility level, in uppercase.

The value must:

  • Be left-aligned within the variable
  • Be padded on the right with blanks if its length is less than the variable

The following levels can be specified to set to specify the compatibility behavior of dynamic SQL statements in packages:

VvvRrMmmm

Compatibility with the behavior of the identified Db2 function level. For example, V13R1M506 specifies compatibility with the highest available Db2 13 function level. The equivalent function level or higher must be activated.

Start of changeFor the new capabilities that become available in each application compatibility level, see: End of change

Tip: Start of changeExtra program preparation steps might be required to increase the application compatibility level for applications that use data server clients or drivers to access Db2 for z/OS®. For more information, see Setting application compatibility levels for data server clients and drivers.End of change
V12R1
Compatibility with the behavior of Db2 12 function level 500. This value has the same result as specifying V12R1M500.
V11R1
Compatibility with the behavior of Db2 11 new-function mode.
V10R1
Compatibility with the behavior of DB2® 10 new-function mode. For more information, see V10R1 application compatibility level.

Examples for SET CURRENT APPLICATION COMPATIBILITY

The following examples set the CURRENT APPLICATION COMPATIBILITY special register to 'function-level' (in the second example, host variable HV1 = 'function-level').
  EXEC SQL SET CURRENT APPLICATION COMPATIBILITY = 'function-level';
  EXEC SQL SET CURRENT APPLICATION COMPATIBILITY = :HV1;