Chapter Contents

Previous

Next
SAS/CONNECT User's Guide

Open a Queue

An application generally wants to access one or more queues. In order to open a queue, you must supply your station instance, the queue's name, the open mode, and one or more queue attributes. The station instance has already been instantiated, and the queue name is whatever you use to refer to the queue. Queues can have up to 32 byte names.

The open mode is determined by the way the queue is used. There are four options for open mode:

You may specify only one mode when you open a queue. If you need to open the queue in multiple modes, you will need to open it multiple times. For example, if you want the queue for DELIVERY and FETCH, you must open it two times.

The open attributes are used to specify characteristics of the queue and are applied when the queue is opened.

queueID = loadclass('sashelp.connect.queue');

   /****************************************/
   /* Open MyQueue for DELIVERY.           */
   /****************************************/
deliveryQ = instance(queueID);
call send(deliveryQ, '_open', stationInst, 
   "MyQueue", "DELIVERY", rc, "DYNTEMP");

   /****************************************/
   /* Open MyQueue for FETCH.              */
   /****************************************/
fetchQ = instance(queueID);
call send(fetchQ, '_open', stationInst, 
          "MyQueue", "FETCH", rc, "POLL");

Note:   By default, if you query for a message and there is no message, you must wait until a message is received. If you do not want to wait, use the POLL attribute to open the queue.  [cautionend]


Chapter Contents

Previous

Next

Top of Page

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