|
This topic describes some ways you can use the OUTPUT, STATUS,
and CANCEL exit. The TSO/E-supplied default exit and the sample exit
in SYS1.SAMPLIB, perform many of the tasks listed below. However,
if you write your own exit routine, you may want your exit to perform
some of the same tasks that the default and sample exits perform,
such as restricting users from processing other users' jobs. - Restrict users from using the STATUS command to obtain the status
of other users' jobs
You may want to restrict most of your users
from displaying the status of other users' jobs. You may also want
to allow certain users, such as a system programmer or operator, to
obtain the status of any job, or a subset of jobs. To tailor the
use of the STATUS command, the exit could: - Check word 7 to determine if the command code is 0 (STATUS command)
- Check the user ID, job name, and jobid to determine, based on
your own criteria, whether you want the user to obtain the status
of the job
If the user can obtain the job's status, set a return
code of 0, and return.
If the user should not obtain the job's
status, set an appropriate return code based on the type of processing
you want to perform. For example, the exit could supply a message
that prompts the user for a different job name and/or jobid. The
exit obtains storage for the message and supplies the message text.
The exit supplies the address of the message in word 5 of the parameter
list, sets a return code of 4, and returns to the command processor. The command processor displays
the message, obtains the user's response, and invokes the exit again
passing the user's response in word 6. The exit can then perform
processing based on the user's response.
Instead of prompting
the user for information, the exit could simply display an informational
message and then cancel the processing for that job. In this case,
the exit obtains storage for the message and supplies the message
text. The exit supplies the address of the message in word 5 of the
parameter list, sets a return code of 8, and returns to the command processor. The command processor displays
the message and invokes the exit again. The exit can then set a return
code of 12 to cancel the processing of that particular job and return
control to the command processor.
- Let certain users cancel other users' jobs
For example, you
may want to allow an operator to cancel any job. The exit could: - Check word 7 to determine if the command code is 4 (CANCEL command)
- Check the user ID to determine if the user can cancel the job
If
the user can cancel the job, the exit sets a return code of 0, and
returns.
If the user cannot cancel the job, the exit can first
use return code 8 to display an informational message to the user.
When the exit receives control again, it can set a return code of
12 to cancel the request for the job.
- Restrict a user from processing the output of another user's job
You
may want users to process only the output of their own jobs that they
have submitted. The exit could: - Check word 7 to determine if the command code is 8 (OUTPUT command)
- Check the user ID and the job name to determine, based on your
own criteria, whether the user can process the job output.
If the
user can process the output, the exit sets a return code of 0 and
returns.
If the user should not process the output, the exit
can set an appropriate return code based on the processing you want
to perform. For example, the exit can supply an informational message
and then cancel the processing for that job.
- Restrict a user from changing a job's output class.
You may
want to prevent certain users from using specific output classes.
You can use the exit to check if a user is changing a job's output
class. The exit can: - Check word 7 to determine if the command code is 8 (OUTPUT command)
- Check the third word pointed to by word 10 and determine if the
user specified a new class on the OUTPUT command
- Check the user ID and determine, based on your own criteria, whether
the user can use the new class
If the user can use the new class
or did not specify a new class, set a return code of 0, and return.
If
the user cannot use that output class, the exit can either cancel
processing for that job or change the output class the user specified.
To change the output class, the exit can first display an informational
message to the user. The exit obtains storage for the message and
supplies the message text. The exit supplies the address of the message
in word 5 of the parameter list, sets a return code of 8, and returns
to the command processor.
The command processor displays
the message and invokes the exit again with the same job name. The
exit can then update the new class (word 3 that word 10 points to)
and return with a return code of 0.
|