Is there any duplicate key or duplicate record error in Adabas?

I am writing a Natural program for inserting and storing many records into an Adabas file. There are chances of duplicates records getting inserted in same file. Is there any duplicate key or duplicate record error in Adabas, which may cause Abend? Should I handle such error as we do in DB2?


It depends on whether your DBA has established a unique attribute on a descriptor value. If not, you can have an entire file full of duplicate records. If so, you can get an Adabas response code 198:

With Natural, it is typically up to the programmer to have some knowledge of any descriptors that should be unique and to perform the necessary check for the existence of a “primary key” value before storing a record. In Adabas, there is no concept of primary key even though it’s possible to use the unique attribute. My experience is that it is seldom used.

The remedy for this is to not allow a programmer who would do such a thing near a keyboard.

The Adabas rsp 198 will be seen as an error 3198 in Natural, btw.

As a sidenote:

this is one of the few cases where the response code is different on the
mainframe and LUW, the equivalent on LUW is a rsp 98.