if (error_code.ec_fields.Bytes_Available != ð)

{

printf("ATTEMPT TO REGISTER EXIT POINT FAILED WITH EXCEPT￿ION: %.7s", error_code.ec_fields.Exception_Id);

exit(1);

}

Message Data—Example:If your program needs to handle different excep different ways, you may need to make use of both the message data message ID. The message data is returned in the same format as when display the message description on an AS/400. For example, if message CPF3C1E is received, some of the message data is printed. You can se message data that is associated with the message by using the Displ Description (DSPMSGD) command. The message data for message CPF3C1E is defined as:

BIN(4)

Parameter number

CHAR(256)

ILE entry point name

To receive all of the message data for this exception, the exceptio error code structure would need to be at least 260 bytes in size. example uses only the number of bytes shown for the parameter number exception in the message data; therefore, the exception data field 4 bytes.

int parm_number; char \temp_ptr;

if (error_code.ec_fields.Bytes_Available != ð)

{

if (memcmp(error_code.ec_fields.Exception_Id,"CPF3C1E",7)==ð)

{

printf("\nFAILED WITH CPF3C1E:"); temp_ptr=&(error_code.exception_data); parm_number=\((int \)temp_ptr);

printf("\n Parameter number omitted: %d",parm_number);

}

else

{

printf("ATTEMPT TO REGISTER EXIT POINT FAILED WITH EXCEPT￿ION: %.7s", error_code.ec_fields.Exception_Id);

exit(1);

}

}

Error

Handling

Signaled

by

API

 

 

 

 

 

The

second

means

of exception handling is by having

all

exceptions

signa

the

API

to

the

calling program. To have all exceptions

signaled by the

bytes provided

field of the error

code

structure

to zero. Refer t

of

your

specific

programming language

for

information

on

exception

handlin

4-6System API Programming V4R1

Page 96
Image 96
IBM Version 4 manual Second, Exception handling is by having All Exceptions Signa