NAT3009 returned abending a job

We are facing a issue of job abending with the error NAT3009. When checked we could find the below reasons for this abend code
The last transaction has been backed out by Adabas because an Adabas
time limit has been exceeded or because of a security violation.
This error may also occur if an Adabas OP command is required
(Adabas parameter OPENRQ=YES) but an Adabas command was issued
without an OP command having been issued before.
For the detailed reason see the subcode.

But we are not very sure of how this happens and how to resolve this.
Please help us out.

The most common reason for a 3009 is the first reason cited in the documentation, namely an Adabas timeout.

Consider the following code:

READ some file
IF some condition
::
UPDATE
END-IF
:: /* more processing
END-READ

Since the UPDATE corresponds to the READ, the READ command to Adabas will be L4, L5, or L6, which are reads with “hold” (update intent).

The very first record read will start a “stop watch”. If an End Transaction, or a Backout Transaction is not issued within the time limit specified by the ET timeout parameter, a 3009 will be issued.

Suppose only a few records out of 20 million on the file will pass the IF test and hence be updated. Further, suppose that there is some processing required for all records, whether updated or not. It is likely that you would get a 3009. The solution is quite simple, you could have a GET within the IF clause. The code would be something like:

IF some condition
GETR. GET … /* current record using *ISN
UPDATE (GETR.)
END TRANSACTION
etc

The READ would now be an L1, L2, or L3 which do not have update intent (they will not be held). When a record passes the IF test, it will be obtained by the GET, which will be a read with hold (since there is an update that refers to it).

WARNING. If a large percentage of the records are to be updated, the original code, modified to count records, and issuing an ET say every 100 records, would almost certainly be preferable.

We are not in a positiion to make the changes in the code right now as it requires a lot of time in sense of testing and promoting to different regions. So is there any way to override the timeout parameter using JCL?

I found this while searchin

The following ADARUN timeout parameters can be set at nucleus startup:

Parameter Specifies the maximum elapsed time (in units of 1.048576 seconds) …
TNAA an access-only user may be active without issuing an Adabas call.
TNAE an ET-logic user may be active without issuing an Adabas call.
TNAX an exclusive-control user may be active without issuing an Adabas call.
TT permitted for a logical transaction by an ET-logic user.

If not specified, a timeout parameter value defaults to 900 or slightly over 15 minutes.

These parameter values, which apply to all users in the session, can be overridden for a single user with an Adabas OP command for the user session.

Could this be possibe using a jcl change?

The ADARUN parameters for the timeout values (TT, TNAE…) are provided with the Adabas nucleus startup in DDCARD.

Specifying these parameters within the Natural batch job does not influence the timeout process of the nucleus.

For the Adabas rsp-code 9 it would be helpful to have the subcode - should be provided by Natural. If a batch job run for years and now gets the rsp-code 9 it is probably because of the other activities on the database and caused by a too small LP parameter. You have to increase the WORK dataset and start the Adabas nucleus with a bigger value for LP (again an ADARUN parameter).

The subcause code we are getting is 15. This job was running successfully for a long time since we got a large file to process last week . This is having large number of updates in Adabas DB than normal which I thinks is the cause for this issue.

Which parameter should be changed for this?

From the SAG documentation for RC 9 sub 15

15 The user was backed out because a pending Work area overflow occurred during this operation.

Action: Either reduce the transaction length to lessen the data protection area requirement, or increase the protection area on Work.

Please note: There is no reason to have to post questions about response codes. Just google “Adabas response code 9”