MSMQ Call Routines |
Syntax | |
Arguments | |
Example |
Syntax |
CALL MSMQOPENQUEUE(qid, access, shareMode, hQueue, rc); |
Numeric, input
Specifies the queue identifier that represents the format name of the queue to be opened.
Character, input
Indicates the level of access that users have to the messages in the queue being opened. The following values are valid:
Specifies that messages can only be looked at.
Specifies that messages can only be sent to the queue.
Specifies that messages can be looked at and removed from the queue.
Character, input
Specifies how the queue is shared. The following values are valid:
Specifies that the queue is available to everyone.
Specifies that the process making this function call is the only one that can receive messages from this queue. If the queue is already opened for receiving messages by another process, then this call will fail.
Numeric, output
Returns the MSMQ handle of the opened queue. This handle is used by subsequent CALL routines to identify and access the queue.
Numeric, output
Provides the return code from the CALL routine. If an error occurs, then the return code is nonzero. A return code of -1 reflects a SAS internal error. Otherwise, it represents an MSMQ error code. You can use the SAS function SYSMSG() to obtain a textual description of the return code.
Example |
This example opens a queue for sending messages.
length msg $ 200; hQueue=0; rc=0; CALL MSMQOPENQUEUE(qid, "SEND", "SHARE", hQueue, rc); if rc ^= 0 then do; put 'MSMQOpenQueue: failed'; msg = sysmsg(); put msg; end; else put 'MSMQOpenQueue: succeeded';
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.