CL Programming

Managing the Storage Used by a Data Queue

Each entry receives a storage allocation when sent to a data queue. The storage allocated will be the value that is specified for the maximum entry length of the data queue that was specified on the Create Data Queue (CRTDTAQ) command. When receiving an entry from a data queue, the data queue removes the entry, but it does not free the auxiliary storage. The system uses the auxiliary storage again when sending a new entry to the data queue. The queue grows larger when not receiving entries that are sent to the queue. Performance is better by maintaining the size of the queue to less than 100 entries. If a data queue has grown too large, delete the data queue by using the Delete Data Queue (DLTDTAQ) command. On completion of the data queue deletion, re-create the queue by using the Create Data Queue (CRTDTAQ) command.

There is another way to manage the size of a data queue on Release V4R5M0 and beyond. This consists of using the SIZE and AUTORCL keywords on the CRTDTAQ command. You can use the SIZE keyword to specify the maximum number of entries and the initial number of entries for the data queue. You can use the AUTORCL keyword to indicate if the data queue should have storage automatically reclaimed when the queue is empty. Specifying *YES for AUTORCL and allocating additional storage to the queue allows for automatic storage allocation when the queue is empty. The amount of storage allocated equals the initial number of entries specified for the queue. If AUTORCL contains a value of *NO, which is the default, the system does not automatically reclaim storage from unused space. To reclaim the storage the data queue uses, you would need to delete and re-create it as described in the preceding paragraph.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]