About MAXWAIT
The MAXWAIT task attribute defines the maximum waiting period (in seconds) that a COMSTP program waits on a DMS II Lock, Secure, or Begin Transaction. If you have large transactions or do not want to time out, set MAXWAIT to a large value in your Generate and Configure WFLs.
MAXWAIT is provided primarily to cater for online reorganizations. In an online reorganization, your COMSTP programs can continue to run while the database is being reorganized. However, in this situation, a COMSTP program might have to wait a considerable time for a transaction to complete.
If a Report requires a DMS II resource that is not available, the Report is suspended until that resource becomes available. Any error condition arising due to resources not being available results in the Report terminating abnormally. Normal recovery functions can be used to resume the operation of the Report.
The MAXWAIT value is also used as the response timeout for any SEND() command whose destination is either NON.LINC or NON.FORMAT. If a timeout occurs, the values of GLB.STATUS and GLB.HUBSTATUS reflects this (TOUT and TIMEOUT respectively).
How MAXWAIT works
For COMSTP programs, MAXWAIT has a default setting of 30 seconds maximum wait time. If this time is exceeded, the program resumes, and the aborted DMS command causes an error message to be returned to the initiating terminal.
If the DMS II resource does not become available within the default time setting, the current transaction is immediately aborted (without any retries), and the following message is displayed on the Status line of your terminal:
"Resource locked out - re XMIT to retry"
If the locked out DMS II resource is a data structure (an <<Ispec>> class) or a table in a Profile for which duplicates are not allowed, the error is returned immediately, without waiting the MAXWAIT time.
Modifying MAXWAIT
The default MAXWAIT time of 30 seconds might be modified, by changing the following statement:
INTEGER IMAXWAIT := 30 ;
This statement is near the start of the following files:
NGEN28/WFL/GENERATE (used for standard generates) NGEN28/WFL/CONF (used for Transfer/Configure)
These files are a part of Builder on the Dictionary pack.
Note: If MAXWAIT is not set, this is interpreted as a request for a very large MAXWAIT period (greater than 277 hours).
You can set the MAXWAIT for LSS however the MAXWAIT value must not be greater than the COMSTP MAXWAIT value. To set the MAXWAIT value for LSS, use the following command:
WFL MODIFY <system>/LSS on <pack>; maxwait = <value>
For example,
WFL MODIFY SAMPLE/LSS ON TEST; MAXWAIT = 20
You can set the MAXWAIT for reports with the following command:
WFL MODIFY <system>/<report> on <pack>; maxwait = <value>
For example,
WFL MODIFY SAMPLE/CUSTLIST ON TEST; MAXWAIT = 40
Alternatively, you can apply a single MAXWAIT value to all reports by modifying the NGENnnSYS/BLD utility. For example, MODFY (RTUSER) NGEN29SYS/BLD on RTPACK;MAXWAIT=-15. All the reports that are generated above MODIFY will have a MAXWAIT value of 15.
Reference
Refer to SYNCWAIT DASDL option for more information.