Chapter Contents




Send SCL lists to a message queue.



CALL SEND(queueInst, '_sendlist', msgtype, header,
attachlist, rc <, list1...listn>);

Where... Is type... And represents...
msgtype N user-specified message type
header L delivery header list (optional)
attachlist L attachment list (or 0 if none)
rc N return code
list1...listn L message to send which consists of 0 or more SCL lists

The _sendlist method allows one or more SCL lists to be sent to a message queue. Any type of SCL list is supported (named lists, unnamed lists, embedded lists, and recursive 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, 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 _recvlist 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 0 should be specified. Otherwise, a valid attachment list should be passed. 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. It must be re-opened before any subsequent processing can take place on that queue instance.

The list1...listn parameters are the 0 to n SCL lists to send.


This example invokes the _sendlist method on the Queue instance to send two SCL lists with no attachments.

   /* first list to send has 4 items    */
namelist = makelist();
rc=setnitemc(namelist, "Mary Gill",  "STUDENT");
rc=setnitemc(namelist, "Jane Smith", "TEACHER");
rc=setnitemc(namelist, "Julie Jones","PRINCIPAL");
rc=setnitemc(namelist, "Bob Thomas", "COACH");

   /* second list to send is a list     */
   /* that contains two embedded lists  */
mainlist = makelist();

data1 = makelist();
rc = setitemc(data1, 'WORK.ABC', 1);
rc = setitemc(data1, 'SASUSER.COMPANY', 2);
rc = setitemc(data1, 'SASUSER.LOCATION',1);

data2 = makelist();
rc = setitemc(data2, 'SASHELP.BASE',1);
rc = setitemc(data2, 'SASHELP.EIS', 2);

   /* insert the above two lists into   */
   /* mainlist                          */
mainlist = insertl(mainlist, data1);
mainlist = insertl(mainlist, data2);

msgtype = 3;

   /* set the delivery header fields,   */
   /* descriptor & response_queue_name; */
   /* they must be set as named items   */
   /* in the delivery header list       */
header = makelist();
rc = setnitemc(header, 
               "This message contains lists", 
rc = setnitemc(header, "school", 

attachlist = 0;

call send(queueInst, '_sendlist', msgtype, 
          header, attachlist, rc, namelist, 

Chapter Contents



Top of Page

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