On Friday, December 5, 2003, at 12:36  PM, Adam.Driver@xxxxxxxxxxxxx 
wrote:
You might be onto something! I assume the only reason CHGQRYA doesn't
affect batch is because batch submitted queries would have a different 
job
name etc,? This could be good for us, because we don't want to use the
system value if it limits batch.
OK, here's how it works:
QQRYTIMLMT controls the maximum query time for all jobs on the system. 
The shipped value is *NOMAX which allows all queries to run. The 
initial attribute for all jobs is to use the QQRYTIMLMT value. If you 
change this system value the Query Engine estimates the amount of time 
taken to run a query and sends the CPA4259 enquiry message to the user 
informing them that the query will likely exceed the time limit. This 
message allows the user to run the query anyway by answering I to 
ignore. Obviously that will defeat your efforts so you must get the 
system to answer the message automatically. See below for ways to do 
that.
Because QQRYTIMLMT affects all jobs the enquiry message will be sent to 
the batch job and redirected to the system operators message queue. 
This will probably irritate them so again the message must be answered 
automatically or better not sent for batch jobs.
Some of the drawbacks associated with the QQRYTIMLMT system value can 
be mitigated by the CHGQRYA command. The main advantage is that it 
affects only the job in which it is run so batch jobs submitted from a 
job in which CHGQRYA has been run will not be affected, however it 
still suffers from the problem of allowing the user to ignore the time 
limit by answering I to the CPA4259 message.
CHGQRYOPT is an interface to the QAQQINI file and provides the same 
control as CHGQRYA plus some additional control values. If you use 
CHGQRYOPT to create or modify a QAQQINI file in QUSRSYS this will 
affect all jobs because the default query atribute is to use a QAQQINI 
file in QUSRSYS if one exists. If you create QAQQINI files in different 
libraries then you must also use CHGQRYA to activate the new QAQQINI 
file. Since the Query Engine is responsible for checking the time limit 
and sends the message you must still automatically answer the enquiry 
message.
Automatically answering message CPA4259.
========================================
You can automatically answer messages by using one of the following 
techniques:
1/ Change the job to accept the default reply for enquiry messages 
using CHGJOB INQMSGRPY(*DFT) which is a bit drastic and will have other 
ramifications.
2/ You can add a system reply list entry for CPA4259 specifying the 
answer C to cancel. You should specify the desired answer rather than 
accepting the default because a suitably authorised person could 
duplicate the message, change the default reply, and override QCPFMSG 
to their new message file. You must also set the job to use the system 
reply list using CHGJOB INQMSGRPY(*SYSRPYL).
3/ You can duplicate the CPA4259 message to another message file, 
change the valid replies to remove the I, and issue an OVRMSGF command 
in the job forcing the user to provide only C as a valid reply.
Note that any user with command line access can issue CHGJOB to alter 
the INQMSGRPY attribute for their own job unless the user has 
LMTCPB(*YES) specified in their user profile.
I'm also downloading the trial version of CHGQRYOPT, so I'll let you 
know
what I think.
Always interested in feedback.
Regards,
Simon Coulter.
--------------------------------------------------------------------
   FlyByNight Software         AS/400 Technical Specialists
   http://www.flybynight.com.au/
   Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\
   Fax:   +61 3 9419 0175                                   \ /
                                                             X
                 ASCII Ribbon campaign against HTML E-Mail  / \
--------------------------------------------------------------------
 
As an Amazon Associate we earn from qualifying purchases.
	
 
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.