Thursday, August 16, 2012

DSNTEP2 stops after MAXERRORS limit reached

Hi,

Problem description:
This happened when I was using multiple insert script through program DSNTEP2. Idea was to insert the record if that is not present in table.


The execution gave me MAX CC 0008. I knew that some inserts are going to fail due to duplicate record.

Observation: The number of insert statement executed was 10 out of 100. All were failed due to duplicate records.

Question: Why the utility did not process rest of the statement.

Here is why:

There is a parameter which controls the maximum error the DSNTEP2 will encounter before exit. This Parameter is MAXERRORS.

The default value for this parameter is 10.

Solution:

We can override the default value for MAXERRORS as shown below or to a specific definite number.

--#SET MAXERRORS -1

You can embed this command at the begin of the control card statement like

//SYSIN DD *
-#SET MAXERRORS -1

INSERT INTO tablex VALUES('a',1,'x');
COMMIT;

So on...


Cheers,
Prakash C. Singh
IBM Certified DBA

No comments: