Chapter Contents




Send message to a queue.



CALL SEND(queueInst, '_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 to a message queue. 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. msgtype will be surfaced on the receiving side upon return from the query. When surfaced by the query, the message type can be used to determine how many and what type of parameters should be used in receiving the actual message by using the _recv method.

The delivery header is an SCL list that may be specified on the send. Information that can be supplied in the delivery header includes descriptive user-supplied text, a response queue name and a user-definable correlation value. A 0 may be specified if there is no header information to send. Otherwise, the header information may be specified by creating an SCL list that has one or more of the following named items set accordingly:

Descriptive, user-supplied text.

User-supplied response queue name.

User-supplied correlation value.

The attachlist parameter is an SCL list that indicates a list of attachments to be sent with the message. If there are no attachments to send, a zero 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. If an error occurs while sending attachments to the queue, the message and its attachments are NOT delivered to the queue; instead an appropriate error message is returned. See Sending Attachments for more information about 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 that follow are a defined set of warning or 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 messages shown here, use SYSMSG() to determine the exact error message.

indicates that neither the message nor the attachments were sent to the queue because an error was encountered during attachment transfer. See Attachment Error Handling for more information.

indicates that the connection was abnormally terminated. If this return code is surfaced, the queue was abnormally closed. The queue must be re-opened before any subsequent processing can take place on that queue instance.

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.


This example invokes the _send method on the Queue instance to send five parameters with no attachments.

name = "John Doe"
age = 35;
company = "SAS";
code = 13484;
type = 472;
attach = 0;
msgtype = 22;

   /* set the delivery header fields */
header = makelist();
rc = setnitemc(header, "This message contains 
                names and ages","DESCRIPTOR");
rc = setnitemc(header, "inventory", 

call send(queueInst, '_send', msgtype, header, 
          attach, rc, name, age, company, code, 

Chapter Contents



Top of Page

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