Void handler is defined in the same source as the rest of the code at this
point. However, I cannot imagine how putting it in its own source would
change anything, unless somebody else knows of a reason.

David Logan

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf
Of Steve Comstock
Sent: Monday, January 07, 2008 9:28 AM
To: [email protected]
Subject: Re: C++ recovery from (an otherwise) system abend

David Logan wrote:
> All good questions. How it did not work was that none of my printf
> statements were generated, and the S0D6 occurred anyway.
> 
> I know the CEEHDLR is registering my routine because I was getting a
message
> 256, meaning it was already registered, and was being re-registered.
> 
> I'm thinking an ESTAE might work. I would have to restrict it to returning
> to a spot within the assembler code doing the PC instruction, but that's
all
> I really need.
> 
> The code is:
> 
> void handler(_FEEDBACK *fc, _INT4 *token,    
>              _INT4 *result, _FEEDBACK *newfc)
> {                                            
>   printf("tok_sev  =%d\n", fc->tok_sev);     
>   printf("tok_msgno=%d\n", fc->tok_msgno);   
>   printf("tok_case =%d\n", fc->tok_case);    
>   printf("tok_sever=%d\n", fc->tok_sever);   
>   printf("tok_ctrl =%d\n", fc->tok_ctrl);    
> //printf("tok_facid=%3.3s", fc->facid);      
> //printf("tok_isi  =%d\n", fc->isi);         
>   *result = 10;                              
> }                                            
> 
> <...unrelated code...>
> 
> int server_read(int handle, int block_number, void*dest_buffer)      
> {                                                                    
>                                                                      
>    _FEEDBACK fc;                                                     
>    _ENTRY    routine;                                                
>    _INT4     token;                                                  
>                                                                      
>    token = 99;                                                       
>                                                                      
>    routine.address = (_POINTER)&handler;                             
>    routine.nesting = NULL;                                           
>    CEEHDLR(&routine, &token, &fc);                                   
>    if( _FBCHECK(fc, CEE000 ) != 0 &&                                 
>        _FBCHECK(fc, CEE080 ) != 0)                                   
>    {                                                                 
>      printf("CEEHDLR failed with message number %d\n", fc.tok_msgno);
>      exit(2999);                                                     
>    };                                                                
>                                                                      
>    char workareaÝ256¨;                                                  
>    long ecb = 0;                                       
>    int ascb = *(int*)0x224;                            
>    int rc = 0;                                         
>    DEBUG2("2/Our ECB=%p ASCB=%p\n", &ecb, (void*)ascb);
>    do                                                  
>    {                                                   
>        rc=CallPC(data.lx_value,                        
>                  1, handle, block_number, dest_buffer, 
>                  data.data, workarea, &ecb, ascb);     
>    }                                                   
>    while(rc != 1126);                                  
>    return rc;                                          
> }                                                      

Well, I have to admit it all looks proper. One question:
was "handler" in the same source module as your main? I've
never seen a condition handler in the same source; I've
always seen it separately compiled and bound.


Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.

303-393-8716
http://www.trainersfriend.com

   z/OS Application development made easier
     * Our classes include
        + How things work
        + Programming examples with realistic applications
        + Starter / skeleton code
        + Complete working programs
        + Useful utilities and subroutines
        + Tips and techniques

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to