Field Types
Notifies a partner program that an application error has occurred. Use this subroutine in conjunction with APPCSendConfirmed to synchronize processing with the partner program.
Note: Making a successful call to APPCSendError places your program in send state.
Declaration:
subroutine APPCSendError(integer:CONVERSATION_ID,
integer:ERROR_ORIGIN)
library "eslappc"
Arguments:
•CONVERSATION_ID is an integer variable containing the conversation identifier (handle) for the APPC conversation returned by either APPCStart or APPCAcceptStart.
•ERROR_ORIGIN indicates the reason for the error. The valid constants are:
APPC_BadGet |
(Default) Specifies that the error was found processing the data just received. This value causes an APPC_ReceiveError event notification to be sent to the partner. |
APPC_BadSend |
Specifies that the error occurred when building the data to be sent. This value caues an APPC_SendError event notification to be sent to the partner. |
Errors:
APPC_NORMAL_COMPLETION |
Normal completion. |
APPC_ERR_OUT_OF_MEMORY |
Out of memory. |
APPC_ERR_INV_CONV_ID |
Invalid argument: CONVERSATION_ID |
APPC_ERR_INV_ERROR_ORIGIN |
Invalid argument: ERROR_ORIGIN |
APPC_ERR_UNEXPECTED_ERROR |
Unexpected error encountered. |
Example:
# Subroutine error
response to stimulus APPC_EVENT APPC_SystemError ConvID
call APPCGetSystemError(ConvID, # ID from Start/AcceptStart
ErrorIndicator, # Work-request error
WorkRequest, # Work request ID
APPCLastVERB, # APPC Verb reporting error
PrimaryReturnCode, #integer (6 digit number)
SecondaryReturnCode )# integer (8 digit number)
if (ErrorEncountered = ....) then
. . .
end if
# Data received
response to stimulus APPC_EVENT APPC_Data ConvID
call APPCGetString (ConvID,
AnswerString,
NoConvert )
. . .
if (Status = "error") then # If error in answer
copy APPC_BadGet to BadDataRecv # Set argument value
call APPCSendError( ConvID, # Send error notification
BadDataRecd ) # Origin of Error
end if
# Continued
response to stimulus APPC_EVENT APPC_ReceiveError ConvID
# Application-determined response
response to stimulus APPC_EVENT APPC_SendError ConvID
# Application-determined response