Bookmark and Share
RSS

Recent Posts

Use of NEWFUN versus APPLCOMPAT

September 26, 2017

I was recently asked about the differences between DSNHDECP NEWFUN(V11) and the APPLCOMPAT=V11R1 zparm system parameter. It's certainly an interesting question, so let's answer it here.

The DSNHDECP module is created during the Db2 install and is used by the precompiler or coprocessor. The precompiler/coprocessor require a site dependent setting, which is specified in DSNHDECP.

One of the parameters defined in DSNHDECP is NEWFUN. NEWFUN is used to tell the precompiler which version of Db2 SQL should be used when parsing and validating the SQL statements within a program.

When application programs are written in a language such as COBOL, they must be pre-compiled. During this pre-compile process, a database request module (DBRM) is generated with a release dependency marker indicating the Db2 level during the pre-compile. The DBRM is then used as input for the BIND PACKAGE command, which stores the information needed to access the data during application execution.

With application compatibility introduced in Db2 11, the behavior of a given SQL statement is executed at a given code level: e.g., Db2 10 or Db2 11. The SQL statements stored in a given DBRM can be set to run using the behavior of Db2 10 or 11 through APPLCOMPAT, a BIND parameter. Of course, as you move to Db2 12, the APPLCOMPAT level will be set to the different function levels: e.g., V12R1M500 or V12R1M501.

As you should know, Db2 12 will have many more versions of SQL syntax to parse. To support this, a new DSNHDECP parameter, SQLLEVEL, was introduced, while NEWFUN has been deprecated. The SQLLEVEL values will be function-level. Again, this is just used to parse the SQL statement. BINDing the package with a valid function level is still your responsibility.


The IBM Knowledge Center has a complete list of DSNHDECP settings for Db2 12.

Posted September 26, 2017 | Permalink

comments powered by Disqus