Reponse Code 146

Product/components used and version/fix level:

ADABAS/ADASQL/COBOL

Detailed explanation of the problem:

We have a real-time COBOL program that accesses an ADABAS database using ADASQL. It reads an ADABAS file using a FIND command, OPTIONS ISNSIZE 1000. The client wants to raise that limit to 10000 (at least). I updated the ISNSIZE to 10000. It works until around 7500 reads, when it starts getting an ADABAS error 146. I haven’t been about to extract the subcode. It’s clearly blowing out the ISN Buffer, but nobody on staff seems to have an idea on how to fix it (I could possibly change the FIND to a READ LOGICAL, but that introduces other problems.)

So, does anybody have any insight on how to solve this problem? Maybe there’s a simple fix?

Thanks for reading.

Error messages / full error message screenshot / log file:

Question related to a free trial, or to a production (customer) instance?

Increasing ISNSIZE to these numbers will give you minimal performance advantage.

Read below to see it is not needed. From Manual BTW.

I would suggest a better option would be to consider using MultiFetch/Prefetch.

:blush: Gene

ISN Lists and the ISN Buffer

The abbreviation ISN occurs frequently in this manual. It stands for Internal Sequence Number: a reference number that identifies each record uniquely within an Adabas file. Each new record created by the INSERT statement must have an ISN. If you do not allocate the ISN explicitly, it is assigned automatically by Adabas. When allocating ISNs, care should be taken that each ISN is unique and that no ISN that exceeds the MAXISN parameter is specified.

When a FIND statement finds more than one record in the file, Adabas makes a list of the ISNs of these records and returns this ISN list as the result of the FIND operation.

You have the option of providing an ISN buffer, whose size is specified by the ISNSIZE parameter either in the global OPTIONS parameter or in each individual Adabas Native SQL statement. If an ISN buffer of adequate size is provided, Adabas stores the ISN list in this buffer. If an ISN buffer is not provided, or if it is too small to contain the ISN list created by a particular FIND statement, then the excess ISNs are automatically written to the Adabas workfile. They are then read from the ISN buffer and/or from the workfile and returned to the user one by one each time a statement (for example, FETCH) that requires an ISN is executed.

In general, programs run more efficiently if the ISN buffer is large enough to contain the entire ISN list. However, if the ISN buffer has to be made smaller, the program will continue to run exactly as before; the process of buffering excess ISNs in the Adabas workfile is completely transparent to the user.

Eugene (Gene) Miklovich

ADABAS/NATURAL Systems Support and DBA

Cell: 916-202-7047

Normal Hours: 8am-4pm E.T.

Please call or text if assistance needed outside these hours.

Out of Office Notice:

Fri July 4th thru Sun July 13

I’m guessing your ADASQL is generating ACB calls rather than ACBX? The ACB call is limited to 32k for the ISN buffer, so you are probably reading a file that uses 4-byte ISNs (4x7500=30000 bytes).

I don’t know what version of ADASQL you are using or if it supports ACBX, but you would need to regenerate your Adabas SQL calls with the ACBX option enabled to use larger ISN buffer sizes (up to 2gb).

What is your client’s goal? What are they trying to achieve with the larger ISNSIZE option? As Gene says, there isn’t a big performance difference to use a large ISN buffer like this, so just stopping at 7500 is probably your simplest solution and enabling MUTLTIFETCH from the ADARUN parameters is going to give you a bigger performance boost than futzing with the ISNSIZE.

Thanks for the responses! We are running ADASQL 2.4.1. I see what you mean about the ACB/ACBX calls. I had never heard of that before. Helpful.

ADABAS = 8.5

They want to be able to read at least 10000 records from that file. By updating ISNSIZE to 10000, I can read up to around 75000 before I get the ADABAS error 146. Performance - at least right this minute - isn’t the main issue. Getting rid of the 146 is though.

(I tried changing the FIND to a READ LOGICAL, but then I get ADABAS error 121. Which is a subject for another day :slight_smile: )

The current SQL statement looks like:

FIND
DECLARE PLF2 CURSOR FOR
SELECT
FIELD1
FIELD2 ETC
FROM THE-RECORD
WHERE
ID =:ID-PLF1
OPTIONS
ISNSIZE = 10000
SUFFIX = ‘-PLF2’

what happens if you omit the ISNSIZE parameter, set it to 7500 or leave it at its earlier value of 1000? is there an error occurring? As long as the ISNSIZE fits in the buffer (< 32k), the read should continue to work. On the call after the buffer is exhausted, Adabas should load the next ISNSIZE list of ISNs into the buffer. They should be able to read millions of records (although hopefully they’re not trying to read most of the records in the file with a FIND), although other limits might come in to play (LWP, WKP3 size, etc).

ADASQL doesn’t yet support buffers larger than 32k (doesn’t use ACBX calls yet).