Z/OS call from C program to ADABAS for L1 command fails on the first run, but runs on the second

*Product/components used and version/fix level:

Z/OS v3.2, Adabas v8.1*

*Detailed explanation of the problem:

I have the program, written in C language, which can access and read ADABAS files.
After loading ADABAS module, the program runs the commands: OP, number of L1 commands, RC, CL.
The issue I am facing is that on the first run, the program gets an exception inside ADARUN module after reading a specific number of records, always the same, let’s say 13, with dump having this information*

errno information :

Thread Id … 8000000000000000 Errno … 47 Errnojr … C00B028E

*Then, after calling CL and RC command, the program is able to read all records successfully.

Error messages / full error message screenshot / log file:

errno information :
Thread Id … 8000000000000000 Errno … 47 Errnojr … C00B028E

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

Can someone share thoughts why such behavior occurred?
Thanks in advance.

What is the Adabas response code and subcode from the failing L1?

Hello Douglas,

The call to adabas() crashes resulting in the dump with the codes I posted.
The stack in the dump ( relative part ) is here
Information for thread 8000000000000000

Traceback:
DSA Entry E Offset Statement Load Mod Program Unit Service Status
1 ctrace +000000EE CEEEV003 HLE77D0 Call
2 handsegv +00000078 ASIMAIN Call
3 CEEPGTFN +00000064 CEEPLPKA Call
4 EDCXMODE +0000009E CEEEV003 Call
5 __zerrh +000012FE CEEEV003 HLE77D0 Call
6 CEEHDSP +00001B3E CEEPLPKA CEEHDSP HLE77D0 Call
7 +0BE8F5BC Exception
8 +00000000 ADALNK Call
9 RUNPGM +000000DE ASIMAIN Call
10 adabas(cb_par*,void*,void*,void*,void*,void*)

then, the only errors from dump are available as the program doesn’t get ACB returned.

After the crash, which is handled by the application, I run CL, RC commands, and after that repeating OP, L1 run well to the end of the file.

What was the calling sequence before L1 ?

Hello Neil.
The call to OP, following L1 commands.

Then after exception was caught and processed by the application,
I ran CL,RC,OP, and L1 which run well till the end of the file.

What do you see if you issue the operator command to display the Adabas user queue (DUQA) before running the program first time to get the Adarsp 47 ?