Queues

A queue is a sequence of data elements that is identified by a symbolic name. Each element contains record-oriented data of a type specific to the application that is to process it. Elements of different types can be put into the same queue.
For the general type of queue, transactions add (enqueue) elements to the tail of the queue and remove (dequeue) elements from the head of the queue in a first-in first-out (FIFO) way. Each element must be read sequentially and, when read, removed from the queue. Queues support multiple simultaneous requests to enqueue and dequeue elements, growing and shrinking in size in response to the volume of requests. A transaction can requeue elements to another queue for alternative processing.
You can use some queues differently; for example, as a common scratchpad of elements that are to be written, updated, read, and deleted by any transactions. You can also dequeue elements in a different sequence from the sequence in which they were enqueued.
Before a queue can be used, you must define it. For example, a queue definition is used by CICS® to identify the symbolic name and type of a queue, and to define the queue to the appropriate queue manager.

Transient data queues provide the general queue functions. Temporary storage queues are typically used for shared reading, writing, and updating by multiple transactions; for example, as a scratchpad for shared data.
- Transient data queues must be defined to a CICS region before it starts up. In contrast, temporary storage queues can be created any time that an application needs to write to a queue.
- Transient data queues must be read sequentially, and each element can be read only once. (After a transaction reads an element, that element is removed from the queue and is not available to any other transaction.) In contrast, elements that are in temporary storage queues can be read either sequentially or directly. They can be read any number of times and are never removed from the queue until the whole queue is purged.
These two characteristics make transient data queues inappropriate for scratchpad data but suitable for queued data such as audit trails and output that is to be printed. For data that is read sequentially once, transient data queueing is preferable to temporary storage.