I have a couple of questions here
1) I understand that using ENQ/DEQ would make the task to wait until the resource is available. In other words the task is suspended until the resource becomes available and hence transaction will take longer time. But what will happen to the task if it does not use ENQ/DEQ on a resource?
i) If two or more tasks trying to write into a TD queue at the same time (when ENQ/DEQ is not used)what will happen?
ii) If task A writes into queue Q and at the same time task B wants to write into queue Q, won't task B gets suspended/wait until the transaction associated with task A is completed?
From IBM manual
The resource to be enqueued on must be identified by one of the following methods:
Specifying a data area that is the resource. It is the location (address) of the data area in storage that matters, not its contents.
Specifying a data area that contains a unique argument (for example, an employee name) that represents the resource. It is the contents of the data value that matters, not its location. LENGTH is required; the presence of the LENGTH option tells CICS to enqueue on the contents of the data value.
2) I believe, in my case I need to use ENQ on data-area and not the content.
If I give " ENQ RESOURCE (queue-name)" , will it serve the purpose?