PUT QUEUE (COBOL)
The PUT QUEUE statement stores a queue record in the DDLDCRUN or the DDLDCQUE area of the data dictionary. An ID is assigned to the queue record and placed at the beginning or end of its associated queue.
idmscu
The PUT QUEUE statement stores a queue record in the DDLDCRUN or the DDLDCQUE area of the data dictionary. An ID is assigned to the queue record and placed at the beginning or end of its associated queue.
Syntax
►►─── PUT QUEUE ─┬───────────────┬────┬──────────┬────────────────────────────► └─ IDqueue-id─┘ ├─ FIRST ──┤ └─ LAST ◄ ─┘ ►─── FROMqueue-data-location─┬─ TOend-queue-data-location─┬──────────────► └─ LENGTHqueue-data-length───┘ ►─┬────────────────────────────────────────────────┬─────────────────────────► └─ RETURN RECORD ID INTOreturn-queue-record-id─┘ ►─┬────────────────────────────────────┬─ . ─────────────────────────────────►◄ └─ RETENTIONqueue-retention-period─┘
Parameters
- IDqueue-idDirects the queue record to a previously defined queue. Specify the symbolic name of a user-defined field that contains the ID, or the ID itself enclosed in quotation marks.Default:16 blanks
- FIRSTPlaces the queue record at the beginning of the queue.
- LASTPlaces the queue record at the end of the queue. This value is the default.
- FROMqueue-data-locationSpecifies the WORKING-STORAGE SECTION or LINKAGE SECTION entry that is associated with the data to be stored in the queue record. Specify the symbolic name of a user-defined field.
- TOend-queue-data-locationSpecifies the end of the WORKING-STORAGE SECTION or LINKAGE SECTION entry that contains the data to be stored in the queue. Specify the symbolic name of a user-defined dummy byte field or a field containing a data item that is not associated with the queue record.
- LENGTHqueue-data-lengthDefines the length, in bytes, of the area that contains the data to be stored in the queue record. Specify the symbolic name of a user-defined field that contains the length, or the length itself expressed as a numeric constant.
- RETURN RECORD ID INTOreturn-queue-record-idSpecifies the program location in which to return the system-assigned ID of the queue record. Specify the symbolic name of a user-defined PIC S9(8) COMP (fullword) field. The returned ID is used to reference the queue record in subsequent GET QUEUE and DELETE QUEUE statements.
- RETENTIONqueue-retention-periodSpecifies the time, in days, to retain the queue in the data dictionary. Specify the symbolic name of a user-defined fixed binary field that contains the retention period, or the retention period itself, expressed as a numeric constant in the range 0 through 255. A retention period of 255 indicates that the queue is never to be automatically deleted.At system startup, queues with expired retention periods are deleted automatically. The retention period begins when the first record is stored in the queue.The specified retention period takes precedence over retention periods that are associated with previously defined queues. The RETENTION parameter is ignored when the record being allocated is not the first record in the queue.If RETENTION is omitted, the default retention period for dynamic queues is taken. For more information about the default retention period for dynamic queues, see Queue Statement Parameters.
Example
The following example allocates a queue record in the beginning of the RES-Q queue, returns the record ID to the Q-REC-ID field, and retains the queue for 45 days:
PUT QUEUE ID 'RES-Q' FIRST FROM NEW-RES TO END-NEW-RES RETURN RECORD ID INTO Q-REC-ID RETENTION 45.
Status Codes
After completion of the PUT QUEUE function, the ERROR-STATUS field in the IDMS-DC communications block indicates the outcome:
Status code
| Meaning
|
0000 | The request has been serviced successfully. |
0019 | In a DC-BATCH environment, the record size exceeds the MAX LENGTH value in the BIND TASK statement. |
4407 | A database error occurred during queue processing. A common cause is a DBKEY deadlock. For a PUT QUEUE operation, this code can also mean that the queue upper limit has been reached. If a database error has occurred, the CA-IDMS/DC/UCF log usually contains other messages that indicate a problem in RHDCRUAL, the internal Run Unit Manager. If a deadlock has occurred, messages DC001000 and DC001002 are also produced. |
4431 | The parameter list is invalid. Under DC-BATCH, this status indicates that the specified record length exceeds the maximum length based on the packet size. |
4432 | The derived length of the specified queue record is zero or negative. |