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 diagramSET CURRENT APPLICATION COMPATIBILITY=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:

Start of changeVvvRrMmmmEnd of change
Start of change

Compatibility with the behavior of the identified Db2 function level. For example, V12R1M510 specifies compatibility with the highest available Db2 12 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
End of change
Start of changeV12R1End of change
Start of changeCompatibility with the behavior of Db2 12 function level 500. This value has the same result as specifying V12R1M500.End of change
V11R1
Compatibility with the behavior of Db2 11 new-function mode. After migration to Db2 12, this value has the same result as specifying V12R1M100. For more information, see V11R1 application compatibility level
V10R1
Compatibility with the behavior of DB2® 10 new-function mode. For more information, see V10R1 application compatibility level.
Notes:
  • After the activation of function level 500 or higher, the source value for CURRENT APPLICATION COMPATIBILITY cannot be higher than the APPLCOMPAT bind option value.
  • Function level V12R1M500 is the same as V12R1, and V12R1M100 is the same as V11R1.

Examples for SET CURRENT APPLICATION COMPATIBILITY

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