The temporary storage limit can be specified either in the QAQQINI file or on the Change Query Attributes (CHGQRYA) command.
To set the query temporary storage limit for a job using query options file QAQQINI, specify QRYOPTLIB parameter on the Change Query Attributes (CHGQRYA) command to a user library where the QAQQINI file exists with a valid value set for parameter STORAGE_LIMIT.
To set the query temporary storage limit on the Change Query Attributes (CHGQRYA) command itself, specify a valid value for the QRYSTGLMT parameter.
In the case where a value is specified both on the Change Query Attributes (CHGQRYA) command QRYSTGLMT parameter and in the QAQQINI file specified on the QRYOPTLIB parameter, the QRYSTGLMT's value is used.
To set the temporary storage limit for 100 megabytes in the current job, you can use the following Change Query Attributes (CHGQRYA) command:
CHGQRYA JOB(*) QRYSTGLMT(100)
If the user runs any query with an estimated temporary storage consumption equal to or less than 100 megabytes, the query runs without interruption. If the estimate is more than 100 megabytes, the CPA4259 inquiry message is sent by the database. To set or change the query time limit for a job other than your current job, the CHGQRYA command is run using the JOB parameter. To set the same limit for job 123456/USERNAME/JOBNAME use the following CHGQRYA command:
CHGQRYA JOB(123456/USERNAME/JOBNAME) QRYSTGLMT(100)
This sets the query temporary storage limit to 100 megabytes for job 123456/USERNAME/JOBNAME.