![]() |
![]() |
e-docs > Tuxedo > ATMI COBOL Function Reference > Section 3(cbl) - COBOL Functions |
ATMI COBOL Function Reference
|
Name
TPCALL() - routine to send a message to a service synchronously
Synopsis
01 TPSVCDEF-REC.
COPY TPSVCDEF.
01 ITPTYPE-REC.
COPY TPTYPE.
01 IDATA-REC.
COPY User data.
01 OTPTYPE-REC.
COPY TPTYPE.
01 ODATA-REC.
COPY User data.
01 TPSTATUS-REC.
COPY TPSTATUS.
CALL "TPCALL" USING TPSVCDEF-REC ITPTYPE-REC IDATA-REC OTPTYPE-REC ODATA-REC TPSTATUS-REC.
Description
TPCALL() sends a request and synchronously awaits its reply. A call to this routine is the same as calling TPACALL() immediately followed by TPGETRPLY(). TPCALL() sends a request to the request/response service named by SERVICE-NAME in TPSVCDEF-REC. The request is sent out at the priority defined for SERVICE-NAME unless overridden by a previous call to TPSPRIO(). The data portion of a request is specified by IDATA-REC and LEN in ITPTYPE-REC specifies how much of IDATA-REC to send. Note that if IDATA-REC is a record of a type that does not require a length to be specified, then LEN in ITPTYPE-REC is ignored (and may be 0). If REC-TYPE in ITPTYPE-REC is SPACES, IDATA-REC and LEN in ITPTYPE-REC are ignored and a request is sent with no data portion. If REC-TYPE in ITPTYPE-REC is STRING and LEN in ITPTYPE-REC is 0, then the request is sent with no data portion. The REC-TYPE in ITPTYPE-REC and SUB-TYPE in ITPTYPE-REC must match one of the REC-TYPEs and SUB-TYPEs recognized by SERVICE-NAME.
ODATA-REC specifies where a reply is read into, and, on input LEN in OTPTYPE-REC indicates the maximum number of bytes that should be moved into ODATA-REC. If the same record is to be used for both sending and receiving, ODATA-REC should be REDEFINED to IDATA-REC. Upon successful return from TPCALL(), LEN in OTPTYPE-REC contains the actual number of bytes moved into ODATA-REC. REC-TYPE and SUB-TYPE in OTPTYPE-REC contain the replies type and subtype respectively. If the reply is larger than ODATA-REC, then ODATA-REC will contain only as many bytes as will fit in the record. The remainder of the reply is discarded and TPCALL() sets TPTRUNCATE().
If LEN in OTPTYPE-REC is 0 upon successful return, then the reply has no data portion and ODATA-REC was not modified. It is an error for LEN in OTPTYPE-REC to be 0 on input.
The following is a list of valid settings in TPSVCDEF-REC.
Return Values
Upon successful completion, TPCALL() sets TP-STATUS to [TPOK]. When TP-STATUS is set to TPOK or TPESVCFAIL, APPL-RETURN-CODE IN TPSTATUS-REC contains an application-defined value that was sent as part of TPRETURN().
If the size of the incoming message was larger then the size specified in LEN on input, TPTRUNCATE() is set and only LEN amount of data was moved to ODATA-REC, the remaining data is discarded.
Errors
Under the following conditions, TPCALL() fails and sets TP-STATUS to (unless otherwise noted, failure does not affect the caller's transaction, if one exists):
See Also
TPACALL(3cbl), TPFORWAR(3cbl), TPGPRIO(3cbl), TPRETURN(3cbl), TPSPRIO(3cbl)
![]() |
![]() |
![]() |
![]() |
||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |