Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Need help with ABEND RC=S806 RSN=4 and signal handler

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
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    Post subject: Need help with ABEND RC=S806 RSN=4 and signal handler
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

Active User


Joined: 29 Apr 2008
Posts: 309
Location: Maryland

PostPosted: Fri Feb 09, 2018 4:12 am    Post subject:
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    Post subject:
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

Active User


Joined: 29 Apr 2008
Posts: 309
Location: Maryland

PostPosted: Fri Feb 09, 2018 4:25 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SAS Work space - B37 abend santuece1 JCL & VSAM 11 Tue Jun 19, 2018 1:03 am
No new posts JCL to set Return code when Time Out ... vinu78 JCL & VSAM 6 Wed May 30, 2018 11:27 am
No new posts How to force a select query to abend neo4u DB2 7 Mon Apr 23, 2018 1:36 pm
No new posts Need help with 002-030 ABEND in TSO R... Terry Tallian TSO/ISPF 1 Sat Mar 17, 2018 1:13 am
No new posts SIGNAL ON HALT issue packerm CLIST & REXX 1 Fri Oct 20, 2017 6:56 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us