Start of change

CEERCDM—Record information for an active condition

CEERCDM records information for an active condition so that the information can be retrieved later from the condition information block (CIB). Use this service only during condition handling.

Read syntax diagramSkip visual syntax diagram
Syntax

>>-CEERCDM--(--function code--,--information--,--fc--)---------><

function_code (input)
A fullword integer that contains the function code of the following value:
1
Record the data set name of a dump for an active condition.
information (input)
The information to be recorded. When the function_code is 1, the information is a halfword length-prefixed EBCDIC character string that is expected to be the data set name of a dump for an active condition. Language Environment validates that the length is positive and that it does not exceed 44.
fc (output)
A 12-byte feedback code, optional in some languages, that indicates the result of this service. If you choose to omit this parameter, refer to Invoking callable services for the appropriate syntax to indicate that the feedback code was omitted.
The following symbolic conditions are possible:
Code Severity Message number Message text
CEE000 0 The service was successfully completed.
CEE3LA 3 3754 Incorrect parameters were detected.
CEE35S 3 3260 No condition was active when a call was made to condition management.
Start of change

Usage notes

  • After the condition handling functions return control to the application, the CIB that represents the conditions is no longer valid and the recorded information is no longer accessible.
  • If CEERCDM is called more than once for the same condition, the information of the last call is recorded.
End of change
Start of change

Examples

  1. Following is an example of CEERCDM called by C/C++.
    /*Module/File Name: EDCRCDM   */
    
    #include <stdio.h> 
    #include <leawi.h>
    #include <stdlib.h> 
    #include <string.h> 
    #include <ceeedcct.h>  
    
    #ifdef __cplusplus
       extern "C" {
    #endif
       void handler(_FEEDBACK *,_INT4 *,_INT4 *,_FEEDBACK *);
    #ifdef __cplusplus
       }
    #endif
    
    int main() {
    
       _FEEDBACK fc;
       _ENTRY routine;
       _INT4 token;
       int x,y,z;
    
       /* set the routine structure to point to the handler */
       /* and use CEEHDLR to register the user handler      */
    
       token = 99;
       routine.address = (_POINTER)&handler;   routine.nesting = NULL;
    
       CEEHDLR(&routine,&token,&fc);   
       /* verify that CEEHDLR was successful */   
       if ( _FBCHECK ( fc , CEE000 ) != 0 ) {     
          printf("CEEHDLR failed with message number %d\n",            
                fc.tok_msgno);     
          exit(2999);  
       }   
       x = 5;   
       y = 0;   
       z = x / y; 
     }
    /*******************************************************/
    /* handler is a user condition handler                 */
    /*******************************************************/
    void handler(_FEEDBACK *fc, _INT4 *token, _INT4 *result,
                 _FEEDBACK *newfc) {
    
       _FEEDBACK lfc;
       _INT4 funcode;
       _VSTRING  info;
       char *ds_name = "XXXX.YYYY";
    
       /* suppose we have taken a dump of this condition   */
       /* into a dataset XXXX.YYYY.                        */
       
       info.length = strlen(ds_name);
       memcpy(info.string, ds_name, info.length);
       funcode = 1;
       CEERCDM(&funcode, &info, &lfc);    
       if ( _FBCHECK ( lfc , CEE000 ) != 0 ) {      
           printf("CEERCDM failed with message number %d\n",             
                 lfc.tok_msgno);      
           exit(2999);    
       }       
       *result = 10; 
    }
End of change
End of change