MSMQ Call Routines |
Syntax | |
Arguments | |
Example |
Syntax |
CALL MSMQGETQPROP(qid, rc, propids, value1 <,value2, ...>); |
Numeric, input
Specifies the queue identifier that represents the format name of 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.
Character, input
Identifies one or more properties that you want to retrieve. This parameter is a character string with each applicable property separated by a comma. For each property identified by propids, you must provide a value parameter that specifies a variable name to use to hold the returned property value.
The following propids and values are valid:
Retrieves whether the queue accepts only authenticated messages. Initialize the variable appropriately to prevent truncation of the returned value from occurring. The following values are valid:
Specifies the queue accepts either authenticated or non-authenticated messages.
Specifies the queue always requires authenticated messages.
Retrieves the base priority for all messages that are sent to a public queue. The value is a numeric that ranges from -32768 to 32767, where 32767 is the highest priority and 0 is the default priority.
Retrieves the time and date when the queue was created. The value is a numeric that represents the number of seconds elapsed since midnight (00:00:00), January 1, 1970 (Coordinated Universal time).
Retrieves the queue's identifier (UUID). The value is a character string that represents binary data. Initialize the variable appropriately to guarantee that truncation of the returned value does not occur.
Retrieves if messages are also copied to its journal queue. Initialize the variable to a size of at least 32 to guarantee that truncation of the returned value does not occur. The following values are valid:
Specifies that messages removed from the queue are discarded.
Specifies that messages removed from the queue are always stored in its journal queue.
Retrieves the maximum size (in kilobytes) of the journal queue.
Retrieves a description of the queue. The value is a character string. Initialize the variable appropriately to prevent truncation of the returned value from occurring.
Retrieves the last time the queue's properties were modified. The value is a numeric that represents the number of seconds elapsed since midnight (00:00:00), January 1, 1970 (Coordinated Universal time).
Retrieves the MSMQ pathname of the queue. The value is a character string. Initialize the variable appropriately to prevent truncation of the returned value from occurring.
Retrieves the privacy level that is required by the queue. The value is a character string. Initialize the variable appropriately to prevent truncation of the returned value from occurring. The following values are valid:
Specifies that the queue accepts only non-private (clear-text) messages.
Specifies that the queue accepts only private (encrypted) messages.
Specifies that the queue accepts both private and non-private messages.
Retrieves the maximum size (in kilobytes) of the queue.
Retrieves whether the queue uses MQMQ transactions. The value is a character string. Initialize the variable appropriately to prevent truncation of the returned value from occurring. The following values are valid:
Specifies that the queue does not accept transaction operations.
Specifies that all messages that are sent to the queue must always be done through an MSMQ transaction.
Retrieves the type of service that is provided by the queue. The value of the TYPE property is a universal unique identifier (UUID) in the form of a character string that represents the binary data. Initialize the variable to a size of at least 32 to guarantee that truncation of the returned value does not occur.
Example |
This example gets the queue properties and displays them.
length msg $ 200; length base createt jquota modifyt quota 8; length auth journal priv trans $ 10; length inst type $ 32; length label path $ 80; rc=0; CALL MSMQGETQPROP(qid, rc, "AUTHENTICATE,BASEPRIORITY,CREATE_TIME,INSTANCE,JOURNAL, JOURNAL_QUOTA,LABEL,MODIFY_TIME,PATHNAME,PRIV_LEVEL, QUOTA,TRANSACTION,TYPE", auth, base, createt, inst, journal, jquota, label, modifyt, path, priv, quota, trans, type); if rc ^= 0 then do; put 'MSMQGetQProp: failed'; msg = sysmsg(); put msg; end; else do; put 'MSMQGetQProp: succeeded'; put 'authenticate is ' auth; put 'base priority is ' base; /* convert MSMQ create time to SAS datetime format */ createt = createt + 10*365*24*3600 + 3*24*3600 - 5*3600; put 'create time was ' createt datetime.; put 'instance identifier is ' inst; put 'journal enablement is ' journal; put 'journal quota is ' jquota; put 'label is ' label; /* convert MSMQ modify time to SAS datetime format */ modifyt = modifyt + 10*365*24*3600 + 3*24*3600 - 5*3600; put 'last modification time was ' modifyt datetime.; put 'pathname is ' path; put 'privacy level is ' priv; put 'quota is ' quota; put 'transaction requirement is ' trans; put 'type of service is ' type; end;
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.