Incorrect output

Incorrect output problems can take various forms. In general, the problems can be grouped into two categories. The first category is where the remote access request fails. An SQL return code and SNA sense code or TCP/IP return code and reason code are received. In the second category the request works, but the information that received is not correct.

REQUEST FAILS WITH RETURN CODE: When a remote database access fails, normally the user receives a Db2 DDF message. These codes should be investigated and depending on the type of error, the appropriate action taken.

VTAM example

A user receives an SNA sense x'800A0000'. Checking this sense code in the SNA formats manual tells us that either the PIU was too long, or there was not sufficient buffering available for the PIU.

To diagnose the problem, it is easiest to see the PIUs to check whether the length is over the RUSIZE maximum that is defined in the MODETABLE entry for the session. To do this task, take a VTAM® buffer trace of the attempted remote access by starting the trace with ID=<DB2 LU>. Optionally, either (or both) of the Db2 systems can be traced: that is, the local or remote Db2 LU. If the remote Db2 system is traced, we see the PIUs (and the lengths of these PIUs) that the remote Db2 is sending. Large amounts of data are coming from the remote host, so these large PIUs are more likely to be too long than the smaller requests from the local Db2. If the local Db2 is traced, the large PIUs should be seen arriving from the remote Db2. In this trace, look for a PIU that has sense included as part of the RU.

Often a search in INFOSYS, or RETAIN reveals information about the effect of particular VTAM definitions. This often leads to a resolution. If not directly, then indirectly by indicating new areas that can be checked for errors.

Of course, each problem must be treated individually, depending on the information received from the sense codes. Often a VTAM buffer trace helps in understanding a problem that results in a SNA sense code. The trace shows exactly what is happening on the session and the sequence of events that lead up to the issuing of the sense.

Inconsistent data

Under normal circumstances, inconsistent data is not caused by the network. If there is a network problem, all the network users are likely to be affected, not just one application. So, inconsistent data is more likely to be a problem within the database.

For example, if a user does a remote update and the commit fails to complete, the data on the database could be updated or not, depending on how far the commit progressed. A Db2 code, for example, x'00D300FE' might be received when a DDF thread is canceled. In these circumstances, a local request for the updated data should be made to check the actual state of the data to avoid inconsistent data being given to the users.