Db2

 View Only

 Db2 Linux SQL0904N

Roberto Stradella's profile image
Roberto Stradella posted 08/09/26 09:06 AM

Hello,

my customer is migrating from DB2 zOS v 12.0 to Db2 Linux v 11.5.9 in AWS EC2 environment. IBM COBOL online/batch applications running in mainframe have been converted to Microfocus Cobol and are running from a separate AWS EC2 server. Customer is asking to me how to identify SQL0904N errors.

I don't remember to have seen SQL0904N errors in Db2 LUW, except for cases in where I accessed Db2 for z/OS from Db2 LUW via DRDA. I reviewed the IBM Documentation for SQL0904N error message and found that is a DB2 zOS error related. Explained to customer that in Db2 LUW there is no direct equivalent, SQL0904N is the closest generic LUW error when a required resource is unavailable, but many z/OS -904 conditions are mapped in LUW to more specific SQL codes such as SQL0911N, SQL0290N, SQL0954C, or SQL0668N depending on the resource involved. I'm right ?
Customer mentioned that he has previously seen -904 errors in Micro Focus COBOL applications but has not yet provided to me a sample showing the error.
Has anyone already encountered this issue ?
Thanks. Ciao. Roberto.
Luis Enrique Valdez's profile image
Luis Enrique Valdez

Hello Roberto:

In my work place we went thru the same migration scenario and we're now running on Microfocus. 

You're correct that in DB2 LUW, the -904 has been transformed into different specific messages. There's still a chance to get SQL0904N on Db2 LUW. This could happen if you use NICKNAMEs mapped to DB2 for zOS tables. 

Whenever any of these tables fall into a -904 (resource not available) condition on the DB2 for zOS side, this would generate an SQL0904N error message on the DB2 LUW nickname.  

Hope this helps.

Ciao
Luis Enrique Valdez

Madhusudan S M's profile image
Madhusudan S M
Hello Roberto:

SQL0904N is not exclusively a Db2 for z/OS error. Db2 LUW also supports SQL0904N (SQLCODE -904, SQLSTATE 57011) for an unavailable-resource condition. However, the exact reason for the -904 must be determined from the reason code, resource type, and resource name. Db2 LUW may also report other, more specific SQLCODEs for particular resource problems, so a z/OS -904 should not automatically be expected to map to SQL0904N on LUW.IBM's Db2 LUW 11.5 message documentation explicitly lists SQL0904N / SQLCODE -904 / SQLSTATE 57011.Interestingly, the LUW documentation says that the reason/type/resource information refer to Db2 for MVS/z/OS resource types.

Madhusudan