Install the Job Scheduler. See the Job Scheduler Users Guide.
This may require that you restart Adaptive Server.
If Adaptive Server is unnamed, set the server name then restart Adaptive Server:
sp_addserver server_name, local
Any login that runs sp_opt_querystats must have the js_user_role role, and must use a non-Null password to log in to Adaptive Server.
sp_opt_querystats require the sa_role:
grant role role_name to login_name
Create an external login on the loopback server for all users who run sp_opt_querystats:
sp_addexternlogin loopback, <login>, <password>, <password>
Sybase recommends that you set the value for maximum job output to 1000000 to ensure that Job Scheduler can capture all diagnostic output for your queries.
If sp_opt_querystats truncates
the output, increase the value for maximum job output.
Increasing this value consumes no additional resources.