How to handle DB001025 data exception when accessing network data with SQL.

Document ID : KB000054239
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

The DB001025 data exception (which is essentially the same as a S0C7 abend) will occur in SQL when a numeric field contains non-numeric data. For example, a field is defined as zoned, but contains spaces. The SQL engine strictly enforces that the data to adhere to the SQL data type which corresponds to the network data definition for the element being accessed. The usual resolution is that the data should be corrected. How can this bad data be located?

Solution:

In OLQ do a generic SELECT without the WHERE clause and note what row and column contains an * instead of valid data; this will identify where the bad data is.

You could also use SQL to find the rows that cause the problem. Assume the suspected column is called NUMCOL and the invalid data has binary zeroes or spaces. You can execute a query similar to the following:

SELECT EMPID FROM "EMPSCHM"."EMPLOYEE"
WHERE POSITION ('00' IN HEX(NUMCOL)) > 0
OR POSITION('40' IN HEX(NUMCOL)) > 0;

This query will return a list rows, each one containing only an EMPID. The EMPIDs will indicate record occurrences where there is a x'00' (low-values) or x'40' (spaces) in any position (byte) of the NUMCOL element. You can modify this query as appropriate to check various elements in any record receiving the DB001025.