DB2 Connect Version 10.5 for Linux, UNIX, and Windows

Application compatibility on DB2 for z/OS

In DB2® for z/OS® Version 11 and later versions, you can specify whether you want applications to run by using the features and behavior of the current DB2 for z/OS version or of a previous DB2 for z/OS version. For CLI and .NET applications that connect to DB2 for z/OS Version 11 or later data servers, you can control the application compatibility behavior in several ways.

A DB2 for z/OS subsystem that you migrate to a new version goes through several phases. The first phase is conversion mode, in which functions of the new version are not yet available to the system, and the last phase is new-function mode, in which functions of the new version are available. If there is a behavior change between DB2 for z/OS versions, an SQL application uses the old behavior in conversion mode. Application compatibility enables applications that have incompatibilities with the new DB2 for z/OS version to maintain SQL compatibility with a previous DB2 for z/OS version when the subsystem is in new-function mode. Using application compatibility provides a window for adopting new function and making changes to accommodate incompatibilities. Also, with application compatibility, you can introduce new SQL functions or wait until later when you move to new-function mode.

Application compatibility identifies the functional level that is expected by the application. You can set application compatibility in three ways, in the following order of precedence, where option 1 has the highest precedence:
  1. Set the CURRENT APPLICATION COMPATIBILITY special register by setting the application compatibility property in the db2dsdriver.cfg file. When a connection is established with the server, this property controls dynamic SQL statement behavior.
  2. Bind packages with the APPLCOMPAT option, to control the SQL application compatibility of the packages for static SQL. The APPLCOMPAT value also provides the default for the CURRENT APPLICATION COMPATIBILITY special register. You can specify the APPLCOMPAT option for the GENERIC parameter of the BIND command.
    Attention: Setting the APPLCOMPAT option can negatively impact the common packages for JCC, .NET, and CLI. Use a different collection name to find any impact.
  3. Set the APPLCOMPAT subsystem parameter on the DB2 for z/OS server.
The following describes the SQL application behavior for application compatibility settings in either conversion mode or new-function mode:

Example

In the following example, the APPLCOMPAT special register is specified in the <specialregisters> subsection of db2dsdriver.cfg configuration file:

<configuration>
	<dsncollection>
		<dsn alias="sample" name="sample"  host="hotelfvt02.torolab.ibm.com" port="21169"/>
			<specialregisters> 
				<parameter name="CURRENT APPLICATION COMPATIBILITY" value="V11R1"/>
			</specialregisters>
		</dsn>
		<dsn alias="sample" name="sample"  host="hotelfvt02.torolab.ibm.com" port="21169"/>
		</dsn>
	</dsncollection>
	<databases>
		<database name="sample" host="hotelfvt02.torolab.ibm.com" port="21169">
			<specialregisters>  				
				<parameter name="CURRENT APPLICATION COMPATIBILITY" value="V10R1"/>
			</specialregisters>
	 	</database>
		<database name="sample2" host="hotelfvt02.torolab.ibm.com" port="21169">
		</database>
	</databases>
		<parameters>
			<specialregisters>  				 				
				<parameter name="CURRENT APPLICATION COMPATIBILITY" value="V10R1"/> 			
			</specialregisters>
		</parameters>
</configuration>

After a connection is established to the data source name sample ('dsn=sample'), the first attempt to run an SQL statement sets the CURRENT APPLICATION COMPATIBILITY special register to V11R1. The special register that is specified inside the <specialregisters> subsection of the <dsn> section has precedence over other sections. The <specialregisters> subsection in the <dsn> section takes precedence over the <specialregisters> subsection in the <database> section. The <specialregisters> subsection in the <database> section takes precedence over the <specialregisters> subsection in the <parameters> section.

After a connection is established to the data source name sample2 ('dsn=sample2'), the first attempt to run an SQL statement sets the CURRENT APPLICATION COMPATIBILITY special register to V10R1. The special register is set to V10R1 since it is only found in the <parameters> section.