gtpc2maj | C/C++ Language Support User's Guide |
This function informs the remote transaction program that the local TPF
transaction program detected an error.
Upon successful completion of this function, the local TPF transaction
program is in send state, and the remote program is in
receive state. Further action is defined by the transaction
program's logic.
Format
#include <tppc.h>
void tppc_send_error(unsigned int *resid,
struct tppc_return_codes *rcode,
enum t_rtsrcvd *rtsrcvd,
enum t_send_error_type type
enum t_send_error_logdata logdata);
- resid
- This is a pointer to a 4-byte field that contains the resource ID.
This resource ID must be the ID assigned on the initial ALLOCATE for this
conversation or one that was assigned by an incoming ATTACH.
- rcode
- This is a pointer to the structure tppc_return_codes, defined
in tppc.h, where the return code is to be placed.
- rtsrcvd
- This argument is a pointer to a 1-byte field that contains the enumeration
type t_rtsrcvd, where the REQUEST_TO_SEND_RECEIVED indication is
placed. This indication contains RTSRCVD_YES, which indicates
a REQUEST_TO_SEND indication was received from the remote transaction
program. The remote program called tppc_request_to_send
requesting the local TPF transaction program to enter receive state
and placing the remote transaction program in send state.
- type
- This specifies the type of error indication to be sent. This
argument must belong to the enumeration type t_send_error_type,
defined in tppc.h. Use one of the following
values:
- SEND_ERROR_TYPE_PROG
- This value indicates that the TPF transaction program detected an error
that is to be reported to the remote transaction program.
- SEND_ERROR_TYPE_SVC
- This value indicates that a TPF service program detected an error that is
to be reported to the remote LU service program.
- logdata
- This specifies whether the error indication is logged. This
argument must belong to the enumeration type t_send_error_logdata,
defined in tppc.h. Use the value
SEND_ERROR_LOGDATA_NO.
- Note:
- The TPF system does not support the YES option defined by the LU 6.2
architecture.
Return Codes
The following tables contain a list of the primary and secondary return
codes that can be returned to the program that called the
tppc_send_error function based on the conversation state. A
complete list of the return codes and their definitions can be found in Table 37 and Table 38.
Table 39. Return Codes When Conversation in SEND State
Symbolic Name
| Primary Code
| Secondary Code
|
LU62RC_OK
| 0000
|
|
LU62RC_POSTED_DATA
| ....
| 00000000
|
LU62RC_POSTED_NODATA
| ....
| 00000001
|
LU62RC_PARAMETER_CHECK
| 0001
|
|
LU62RC_PK_BAD_TCBID
| ....
| 00000001
|
LU62RC_PK_BAD_CONVID
| ....
| 00000002
|
LU62RC_PK_BAD_OPTION
| ....
| 00C62074
|
LU62RC_STATE_CHECK
| 0002
|
|
LU62RC_SKSENDE_BADSTATE
| ....
| 00000111
|
LU62RC_ALLOC_ERROR
| 0003
|
|
LU62RC_SECURITY_NOT_VALID
| ....
| 080F6051
|
LU62RC_TP_NOT_AVAIL_RETRY
| ....
| 084B6031
|
LU62RC_TP_NOT_AVAIL_NO_RETRY
| ....
| 084C0000
|
LU62RC_TPN_NOT_RECOGNIZED
| ....
| 10086021
|
LU62RC_PIP_NOT_SPECIFIED_CORRECTLY
| ....
| 10086032
|
LU62RC_CONV_TYPE_MISMATCH
| ....
| 10086034
|
LU62RC_SYNLVL_NOTSUPORT
| ....
| 10086041
|
LU62RC_DLLOC_ABEND_PGM
| 0006
|
|
LU62RC_DLLOC_ABEND_SVC
| 0007
|
|
LU62RC_DLLOC_ABEND_TMR
| 0008
|
|
LU62RC_PGMERR_PURGING
| 000E
|
|
LU62RC_CONVFAIL_RETRY
| 000F
|
|
LU62RC_CONVFAIL_NORETRY
| 0010
|
|
LU62RC_SVCERR_PURGING
| 0013
|
|
LU62RC_TPF_ABEND
| FFFF
|
|
Table 40. Return Codes When Conversation in RECEIVE State
Symbolic Name
| Primary Code
| Secondary Code
|
LU62RC_OK
| 0000
|
|
LU62RC_DLLOC_NORMAL
| 0009
|
|
LU62RC_CONVFAIL_RETRY
| 000F
|
|
LU62RC_CONVFAIL_NORETRY
| 0010
|
|
LU62RC_PARAMETER_CHECK
| 0001
|
|
LU62RC_PK_BAD_TCBID
| ....
| 00000001
|
LU62RC_PK_BAD_CONVID
| ....
| 00000002
|
LU62RC_PK_BAD_OPTION
| ....
| 00C62074
|
LU62RC_TPF_ABEND
| FFFF
|
|
Table 41. Return Codes When Conversation in CONFIRM State.
Symbolic Name
| Primary Code
| Secondary Code
|
LU62RC_OK
| 0000
|
|
LU62RC_PARAMETER_CHECK
| 0001
|
|
LU62RC_PK_BAD_TCBID
| ....
| 00000001
|
LU62RC_PK_BAD_CONVID
| ....
| 00000002
|
LU62RC_PK_BAD_OPTION
| ....
| 00C62074
|
LU62RC_CONVFAIL_RETRY
| 000F
|
|
LU62RC_CONVFAIL_NORETRY
| 0010
|
|
LU62RC_TPF_ABEND
| FFFF
|
|
Programming Considerations
- The conversation must be in one of the following states:
send
receive
received-confirm
received-confirm-send
received-confirm-deallocate.
- The value supplied in resid must be the resource ID returned by
the tppc_allocate function or one that was assigned by an incoming
ATTACH.
- The transaction programs can use this function for various application
level functions. For example, the program can call this function to
truncate an incomplete logical record, to inform the remote program of an
error it detected in data it received, or to reject a confirmation
request.
- If the local TPF transaction program calls tppc_send_error
while in receive state, purging of all buffered input
occurs. The incoming information that is purged includes both data
(logical records) and confirmation requests. In addition, if the
confirmation request was due to the remote transaction program's calling
tppc_deallocate with type=DEALLOCATE_TYPE_CONFIRM, the
DEALLOCATE request is also purged. After issuing the
tppc_send_error function from receive state, the local
transaction program is in send state, and the remote transaction
program is in receive state.
- When the rtsrcvd parameter is RTSRCVD_YES, the remote
program is requesting the local TPF transaction program to enter
receive state and thereby place the remote program in
send state. The local TPF transaction program enters
receive state by issuing tppc_receive or
tppc_prepare_to_receive. The remote partner program enters
the corresponding send state when it calls tppc_receive
and receives the SEND indicator on the whatrcv parameter.
- This verb resets or cancels posting. If posting is active and the
conversation was posted, or if posting is active and the conversation was not
posted, posting is cancelled.
- The truncation implied by the use of this verb can cause any of the
following to be truncated:
- Data, sent by means of the tppc_send_data function.
- Confirmation requests, sent by means of tppc_confirm,
tppc_prepare_to_receive, or tppc_deallocate.
- Deallocation request sent by mean of tppc_deallocate with
type=DEALLOCATE_TYPE_CONFIRM.
- See Programming Considerations for Basic Conversation Functions for additional programming considerations relating to the
TPF/APPC basic conversation functions.
Examples
The following example informs the remote transaction program that the local
TPF transaction program detected an error.
#include <tppc.h>
unsigned int resource_id;
struct tppc_return_codes return_code;
enum t_rtsrcvd request_received;
·
·
·
/* set up resource_id with the value returned from the allocate verb */
·
·
·
tppc_send_error(&resource_id,&return_code,&request_received, \
SEND_ERROR_TYPE_PROG,SEND_ERROR_LOGDATA_NO);
/* normal processing path */
·
·
·
Related Information