Chapter Contents |
Previous |
Next |
_query |
Syntax | |
Example |
Syntax |
CALL SEND(stationInst, '_query', etype, msgtype, header, attachlist, cnctionInst, rc); |
Where... | Is type... | And represents... |
---|---|---|
etype | C | type of event received |
msgtype | N | message type of received message |
header | L | delivery header list |
attachlist | L | attachment list |
cnctionInst | N | Cnction instance on which the event was received |
rc | N | return code |
Used for direct messaging, the _query listens on a station instance for incoming events on any connection.
The event type etype is returned with one of the following values:
The msgtype parameter can be set by the user when the message is sent and is surfaced on the query. This value is user-specified, and when surfaced by the query, the user can use the message type to determine how many and what type of parameters should be used in receiving the actual message when using the _recv and _recvlist methods.
The header parameter is an SCL list that returns delivery information. A value of 0 may be passed in to indicate that the delivery information should not be surfaced by the query. Otherwise, header must be passed into the _query as an empty SCL list. If a message event is returned, header is updated with the delivery information.
The attachlist parameter is a list of attachments that have been included with the message. A value of 0 may be passed in to indicate that the attachment list should not be surfaced by the query. In this scenario, the attachment list is never surfaced and so the attachments do not have to be received and accepted. If the value is not 0, attachlist must be an empty SCL list. If a message event is returned, attachlist is updated only if attachments were received along with the message. If attachments are surfaced, actions must be taken to receive the attachments and to indicate that the receipt is complete. See Sending Attachments for more information about the receiving of attachments.
The cnctionInst parameter is set upon return. This indicates the Cnction instance on which the event was received.
If an error or warning condition is encountered during the query, a non-zero return code will be returned in the rc parameter. The return codes that are listed are a defined set of warning and error conditions that can be checked for by using the SYSRC macro, which is provided in the autocall library that is supplied by SAS Institute.
If the parameter rc is not one of the parameters that are listed below, use SYSMSG() to determine the exact error message.
call send(cnctionInst, "_acceptAttachment", 0, rc, "COMPLETE");
Example |
This example queries on the station instance by listening for messages on any connections.
/*************************************/ /* create empty attachment list to */ /* pass into query */ /*************************************/ attachlist = makelist(); call send(stationInst, '_query', etype, msgtype, attachlist, cnctionInst, rc); if (etype = "CONNECT") then do; /**********************************/ /* send message back on new */ /* connection instance */ /**********************************/ msgtype = 5; call send(cnctionInst, '_send', msgtype, 0, 0, rc, "Return string"); end; else if (etype = "DISCONNECT") then end; else if (etype = "MESSAGE") then do; /**********************************/ /* will have meaning to some user */ /**********************************/ if (msgtype = 1) then ...more data lines... end;
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.