IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need help with ABEND RC=S806 RSN=4 and signal handler


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chong.zhou

New User


Joined: 31 May 2017
Posts: 9
Location: Czech

PostPosted: Fri Feb 09, 2018 12:17 am
Reply with quote

First of all, please accept my apologies, because this question is about an LE C program with POSIX(ON) running in a batch job. However, I read through the category list many times but really did not find C/C++ category. But I really need some suggestion about this.

I have a program written in LE C, executed with POSIX(ON) in a batch job. This program uses a DLL, linked with a SIDE-DECK file.

When the DLL it depends on does not exist, the program ended up with ABEND S806/RSN-4, the dump writes:

DESCRIPTION: S806 - A MODULE REQUESTED BY THE PROGRAM COULD NOT BE FOUND.

OK, nothing surprise till now.

But from the SYSPRINT of the job log I noticed that the program actually executed, it even printed out some message until it called the function in the DLL and ABENDed with S806. Therefore I wanted to 'catch' the error and print more error message in order to let it ABEND more gracefully icon_confused.gif

I tried to setup signal handler for SIGABEND using the following snippet:

Code:
void myHandler(int codeAbend)
{
    printf("ABEND %d\n", codeAbend);
    exit(4);
}
...

struct sigaction info,newhandler;
newhandler.sa_handler = myHandler;
sigemptyset(&newhandler.sa_mask);
newhandler.sa_flags = 0;
sigaction(SIGABND, &newhandler, &info);


But neither was the error message printed out, nor was the exit code changed to 4. It still ABENDed with S806.

I checked the return code of sigaction(), it was 0, not SIG_ERR. I also tried ANSI function signal(SIGABND, myHandler), but I still did not make it.

Finally I tried to raise the signal on my own by raise(SIGABND). This is time my program caught the ABEND.

Is there anything I did wrong? Or this kind of ABEND simply cannot be caught at all? If so, why doesn't IBM's document mention it? icon_mad.gif

Thank you guys very much!
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Fri Feb 09, 2018 4:12 am
Reply with quote

More specific details on this issue are required to get any meaningful answer.

ABEND S806 only means that the name of the 'called function in the DLL' is not defined properly, or its name is not available for some reason at the moment of (dynamic) CALL, which is actually LINK in terms of Assembler programming.

I don't remember the details, but most likely ABENDs like S806 (e.g. those raised inside of zOS components) cannot be handled by application in this manner, like sigaction().
Back to top
View user's profile Send private message
chong.zhou

New User


Joined: 31 May 2017
Posts: 9
Location: Czech

PostPosted: Fri Feb 09, 2018 4:21 am
Reply with quote

sergeyken wrote:
More specific details on this issue are required to get any meaningful answer.

ABEND S806 only means that the name of the 'called function in the DLL' is not defined properly, or its name is not available for some reason at the moment of (dynamic) CALL, which is actually LINK in terms of Assembler programming.

I don't remember the details, but most likely ABENDs like S806 (e.g. those raised inside of zOS components) cannot be handled by application in this manner, like sigaction().


Thank you for your quick response, Sergeyken. I know S806 has several meanings depends on different RSNs. But actually I'm not investigating a root cause of a problem. I clearly know the ABEND was caused by a missing DLL because I created the situation. I just would like to know if it is possible for an application to catch the error at runtime.

So, since you suggested that an application cannot catch this error through signal handling, I think I have to find other way around.

Thank you again.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Fri Feb 09, 2018 4:25 am
Reply with quote

chong.zhou wrote:

So, since you suggested that an application cannot catch this error through signal handling, I think I have to find other way around.

I guess so, but am not 100% sure, and now I cannot verify this.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts ISAM and abend S03B JCL & VSAM 10
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts Abend S0C4 11 (Page Translation Excep... PL/I & Assembler 16
No new posts WER999A - UNSUCCESSFUL SORT 8ED U Ab... SYNCSORT 5
No new posts the system or user abend SF0F R=NULL COBOL Programming 0
Search our Forums:

Back to Top