Application compatibility on Db2 for z/OS

In Db2 for z/OS, 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, Java, and .NET client applications that connect to Db2 for z/OS data servers, you can control the application compatibility behavior in several ways.

Application compatibility enables applications that have incompatibilities with a new Db2 for z/OS function level to maintain SQL compatibility with a previous Db2 for z/OS function level. You can use application compatibility to separate the Db2 for z/OS migration and function level activation processes from application updates.

Application compatibility identifies the functional level that is expected by the application. You can set application compatibility in one of the following ways:
  1. 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.
  2. Set the APPLCOMPAT subsystem parameter on the Db2 for z/OS server.

Examples

In the following example, the CURRENT APPLICATION COMPATIBILITY 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.