Data Management

 View Only

APPLCOMPAT abbreviation support for SQL statements in Db2 13 for z/OS

By Paul McWilliams posted 14 days ago

  

By Paul McWilliams and Liyan Zhou.

With the PTF for APAR PH64377 in Db2 13 for z/OS, you have the option to use APPLCOMPAT as an abbreviation in various SQL statements, where only the fully spelled-out form of APPLICATION COMPATIBILITY was allowed. This small but useful improvement simplifies the writing of SQL statements that use this syntax and reduces the chance of SQL errors from typos and spelling errors. 

The new abbreviation is also consistent with the spelling of the existing related APPLCOMPAT bind option and APPLCOMPAT subsystem parameter, making it already familiar to DBAs and application programmers.

Specifically, PH64377 enables APPLCOMPAT to be used instead of its long form in any reference to the CURRENT APPLICATION COMPATIBILIY special register, including as SET CURRENT APPLCOMPAT, when you set the special register value. 

The new abbreviation is also accepted as USING APPLCOMPAT in each of the following DDL statements:

The APPLCOMPAT abbreviation is available at Db2 13 function level 100 or higher, and regardless of the APPLCOMPAT level. Note that an exception was made with the introduction of this new SQL syntax.  That is, new SQL syntax is normally introduced in a new application compatibility level. 

However, the very purpose of the new APPLCOMPAT abbreviation is to simplify writing of statements that specify or even change the application compatibility level. So, Db2 developers recognized that requiring a certain application compatibility level for the APPLCOMPAT abbreviation would likely reduce its usefulness, and possible cause confusion or even frustration. 

By introducing the new abbreviation without requiring a higher application compatibility level, we avoid the frustrating situation where you might issue SET CURRENT APPLCOMPAT, specifying any lower level, and then immediately be prevented from using the abbreviation again until returning to the higher level.

The potential problems with allowing the new syntax at any application compatibility level are also mitigated by the facts that use of the abbreviation is completely optional, existing applications and SQL statements can continue to use the spelled-out form as before, and the result is the same regardless of which spelling is used.  

That said, it is probably a best to wait until the PTF is applied on every Db2 data sharing member before using the abbreviation in applications that might run the statements on different data sharing members.

 #Db2forz/OS

0 comments
6 views

Permalink