Examples of setting query temporary storage limits
The temporary storage limit can be specified either in the QAQQINI file or on the Change Query Attributes (CHGQRYA) command.
You can set the query temporary storage limit for a job using query options file QAQQINI. Specify the QRYOPTLIB parameter on the Change Query Attributes (CHGQRYA) command. Use 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.
If 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 value is used.
To set the temporary storage limit for 100 MB 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 MB, the query runs without interruption. If the estimate is more than 100 MB, 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 MBfor job 123456/USERNAME/JOBNAME.