Chapter Contents

Previous

Next
_send

_send



Message exchange between two bound session instances.


Syntax
Example

Syntax

CALL SEND(cnctionInst, '_send', msgtype, header,
attachlist, rc <, parm1,...,parmn>);

Where... Is type... And represents...
msgtype N user-specified message type
header L delivery header list (or 0 if none)
attachlist L attachment list (or 0 if none)
rc N return code
parm1...parmn N or C message to send, which consists of 0 or more numerics or characters in any order

The _send method allows a message to be sent between two bound session instances. A message can consist of numerics and/or characters. SCL lists are not supported by _send; use _sendlist to send SCL lists.

The msgtype parameter is set by the user when the message is sent and will be surfaced on the receiving side upon return from the query. When surfaced by the query, on the receiving side, the message type can be used to determine how many and what type of parameters should be used in receiving the actual message using the _recv method.

The delivery header parameter is an SCL list that represents delivery information that is to be included. This information is surfaced on the query so it may be viewed by the receiver. If there is no information to include, header may be set to 0. Otherwise, header should be a valid SCL list, which consists of supported named items that are used to relay delivery information.

The attachlist parameter is an SCL list that represents a list of attachments to be sent with the message. If there are no attachments to send, a 0 should be specified. Otherwise, a valid attachment list should be passed in. This attachment list will be surfaced by the query on the receiving side. The receiving side then has the flexibility to decide which (if any) attachments to receive. See Sending Attachments for further details about the specific syntax for attachlist.

If an error or warning condition is encountered during the send, a non-zero return code is returned in the rc parameter. The return codes listed are a defined set of warning and error conditions that can be checked by using the SYSRC macro, which is provided in the autocall library that is supplied by SAS Institute.

If the rc is not one of the parameters that are defined below, use SYSMSG() to determine the exact error message.

_SEREL
This return code indicates that the send failed because the previous message (surfaced by a query) has not been received. When _query returns a message, no sends are allowed on that connection until the previous message is received using the _recv or _recvlist method.

_SEATTAC
This return code indicates that the send failed because the attachment transfer is not complete. If the previous message surfaced by the query had attachments, no sends will be allowed on the connection until the _acceptAttachment method is called by using the COMPLETE flag. This signals that attachment transfer is complete. The COMPLETE flag may be specified without an attachment list to signal that no attachments are to be received and that attachment acceptance is complete:
call send(obj, "_acceptAttachment", 
          0, rc, "COMPLETE");

_SEDISCP
This return code indicates that the send failed because a DISCONNECT is pending on this connection. If this return code is surfaced, _query should be called for this connection so that the disconnect can be received and the resources cleaned up.

_SWATTXF
This return code is a WARNING that indicates that the message was sent successfully, but one or more errors were encountered during attachment transfer. See Attachment Error Handling for more details.

The parm1...parmn parameters are the 0 to n numeric and/or character values that are sent. Any number of parameters can be sent in any order.


Example

This example invokes the _send method on the Cnction instance to send 5 parameters with no attachments.

name = "John Doe"
age = 35;
company = "SAS";
code = 13484;
type = 472;
msgtype = 11;
header = 0;
attachlist = 0;

call send(cnctionInst, '_send', msgtype, 
          header, attachlist, rc, name, 
          age, company, code, type);


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.