The CA Datacom Core - 15.1 section "DQOPTLST Parameters" defines RTIMDQW as follows:
Specifies the number of seconds batch CA Dataquery™ for CA Datacom® is to wait before reusing a partition of the Work Table (DQW) which is marked as being "in use." Partitions may be left marked "in use" after a system failure or batch CA Dataquery™ for CA Datacom® abend. When CA Dataquery™ for CA Datacom® is unable to allocate a partition, the message "CA Dataquery™ for CA Datacom® WAITING FOR RESOURCES" appears.
- Valid Entries:
60 -- 32000
- Default Value:
In general, the large default value (7200 which is 2 hours) for RTIMDQW was suggested to avoid interfering with a currently running query.
It is recommend that DQOPTLST RTIMDQW is set to the projected length of the longest running query that may exceed 2 hours.
It may also be that RESOURCES NOT AVAILABLE is encountered when there are no Dataquery queries running at the moment.
Here is a possible scenario...
Let's say there is a two partition DQW table.
Partition 1 has a query that is currently running, and so the partition is marked as "in use." Also, the query in Partition 1 has been running longer than the time specified in RTIMDQW.
Partition 2 is marked "in use" from another query that had been running previously but was just recently cancelled.
A third query is submitted and because both partitions are now marked "in use," Dataquery looks to see if any have exceeded RTIMDQW.
Under these conditions, Dataquery will attempt to run the third query in Partition 1.
Since there is already a query running in that partition, DATAQUERY WAITING FOR RESOURCES or DATAQUERY RESOURCES NOT AVAILABLE results.
RESOURCES NOT AVAILABLE may also be encountered when there are no Dataquery queries running at the moment since some cancellation or abend.
Dataquery as designed does not have the ability to distinguish between a DQW "in use" partition that is still processing a currently running query or one that has been cancelled or abended.
In either case, reformatting the DQW table becomes necessary.
To reformat the DQW table, use the DQWFINIT batch utility. DQWFINIT formats every record in the DQW table and can be time consuming.The larger the DQW is, the longer DQWFINIT takes.
So, it may be good to run the DQWFINIT from another Multi-user environment then take and retain a DBUTLTY BACKUP of the reformatted DQW..
That BACKUP could then be used to INIT and LOAD for a quicker rebuild of the DQW since the DBUTLTY LOAD would run much faster than reformatting the DQW with program DQWFINIT.
Either of these methods require closing Dataquery Base 003 in that environment until the process is complete.
Note, the DQW is a scratch file that only contains critical data when a batch query is actually executing.