CMSEND — Send_Data


CMSEND (conversation_ID, send_buffer, send_length,,
       request_to_send_received, return_code) [LOGGING log_byte]

Where

conversation_ID (character input) specifies the conversation identifier of the desired conversation.

send_buffer (character input) specifies the information to be sent. The form of the information depends on the conversation type.
  • For a basic conversation, send_buffer specifies the data to be sent. The data consists of logical records, each containing a 2-byte length field followed by the data field. The length of the data field can range from 0 to 32765 bytes. The length of the record equals the length of the data field plus the 2-byte length field.
  • For a mapped conversation, send_buffer specifies the data record to be sent. The length of the data record is given by the send_length parameter.
send_length (numeric input) specifies the size of the send_buffer parameter and the number of bytes to be sent on the conversation. The meaning of send_length depends on the conversation type:
  • For basic conversations, the send_length ranges in value from 0 to 32767. When a program issues a CMSEND statement during a basic conversation, send_length specifies the size of the send_buffer parameter and is not related to the length of a logical record.
  • For mapped conversations, the send_length ranges in value from 0 to 32763. When a program issues a CMSEND statement during a mapped conversation, send_length specifies the length of a data record.
request_to_send_received (numeric output) specifies the variable containing an indication of whether or not a request-to-send notification has been received. The request_to_send_received variable can have one of the following values:
  • CM_REQ_TO_SEND_RECEIVED
  • CM_REQ_TO_SEND_NOT_RECEIVED

return_code (numeric output) specifies the result of the statement execution.

log_byte is a 1-byte string constant or a string expression that specifies a byte of user data to be associated with this CPI-C statement during logging. log_byte is also associated with the data which may be transmitted when a CMSEND successfully completes. The log_byte remains active until another CPI-C statement is issued. This byte gives users of the Response Time Utility a way to identify transactions from transmitted or received data when gathering statistics by the various user-defined "log_byte" categories. Only the first character or first two hexadecimal digits of the string expression are used. The default log_byte is X'00'.

Function

 

A local program uses the CMSEND statement to simulate the CPI-C CMSEND call, which is used to send data to the remote program.

When issued during a mapped conversation, the CMSEND statement sends one data record to the remote program. The data record consists entirely of data and is not examined by the LU for possible logical records.

When issued during a basic conversation, this statement sends data to the remote program. The data consists of logical records. The amount of data is specified independently of the data format.

Before issuing the CMSEND statement, a program has the option of issuing one or more of the following statements which affect the function of the CMSEND statement:
  • CMSST — Set_Send_Type
  • If send_type = CM_SEND_AND_PREP_TO_RECEIVE, optional setup may include: CMSPTR — Set_Prepare_To_Receive_Type
  • If send_type = CM_SEND_AND_DEALLOCATE, optional setup may include: CMSDT — Set_Deallocate_Type

For more information on CMSEND and its parameters, refer to the Send_Data (CMSEND) call description in the “Call Reference” chapter of Systems Application Architecture Common Programming Interface Communications Reference.