MainframeSupports
tip week 46/2016:

Have you ever tried to receive a sqlcode -922 or -927. Both of these sqlcodes means you did not get inside DB2. There are several reasons for receiving a -922, but if it is a -927 your program or more correct your LOAD module was LINK/BIND'ed with the wrong version of the entry point DSNHLI. The same error can be reported as a -922 ,but it seldom occurs.

Let me briefly revisit how a program executes a SQL statement. In our program we write EXEC SQL, but when the actual execution takes place the program code calls an entry point by the name of DSNHLI. This entry point is available in a variety of DB2 modules:

Depending on how your program is going to be executed you need to LINK/BIND it with one of the above DB2 modules. If you do not pick the correct DB2 module it will most likely result in a sqlcode -927 or less likely in a -922. One of the consequences of the above is that many installations has two versions of their programs/load modules, one for CICS and one for batch (typically the DSN processor).

In DB2 version 10 IBM finally recognised that this is a terrible mess. So now another DB2 module called DSNULI is available. If your program is LINK/BIND'ed with DSNULI instead of one of the above mentioned DB2 modules then all SQL calls will work no mater what execution environment you choose. Hey that is great and indeed about time.

Maybe you wonder why I have not mentioned IMS. It is because DSNULI does not work with IMS, unfortunately. Oh, I just discovered that it works for IMS in DB2 version 12!! There are also other restrictions described in Application programming and SQL.

Previous tip in english        Forrige danske tip        Tip list