|
Some possible uses of the PRINTDS exits are described below: - Restrict certain users from using the PRINTDS command
The initialization
exit can check the user ID and decide, based on your own criteria,
to cancel the PRINTDS command. The exit can first display an informational
message to the user, for example, using PUTLINE. The exit can then
set a return code of 16 and return to the PRINTDS command processor.
- Change the operands that have a fixed default value
The PRINTDS
initialization exit receives the default exit parameter list (DEPL).
The DEPL contains the default values of PRINTDS operands that have
a fixed default value. The exit updates the appropriate values in
the DEPL, sets a return code of 0, and returns to the PRINTDS command processor.
- Change the operands that the user specifies on the command
You
can use the initialization exit to change the operands that users
specify on the PRINTDS command. The initialization exit receives
the DEPL, which it can use to change the fixed default values of specific
operands.
The initialization exit also receives the address
of the command buffer. It can change the operands the user specifies
on the PRINTDS command by using a new command buffer. For example,
the initialization exit can scan the command buffer to: - Look for conflicts with the operands a user specifies and correct
any errors. For example, the user cannot specify both the TITLE and
CCHAR operands on the PRINTDS command.
- Prevent users from specifying certain operands or certain values
for operands.
To check the command buffer and change its contents, the
initialization exit can: - Scan the command buffer and decide, based on your own criteria,
to change the command the user issued
- Obtain storage for a new command buffer
- Build the new command buffer
- Update the key, length, and data fields for the new command buffer
as follows:
- Key
- X'02'
- Length
- the length of the new command buffer
- Data
- the address of the new command buffer
- Set a return code of 0 and return control to the PRINTDS command processor.
The exit must not change the command buffer it receives.
It must create a new command buffer and return the address of the
new command buffer to PRINTDS. For more information about the command
buffer and the new command buffer, see TSO/E standard exit parameter list. For
information about the format of the command buffer, see Command buffer.
You must also write a termination exit to free
the storage the initialization exit obtains for the new command buffer.
When the PRINTDS command processor invokes the termination exit, it passes the
address of the new command buffer to the termination exit. The termination
exit frees the storage for the new command buffer.
- Provide installation-defined pseudo-operands
If users at your
installation print data sets with the same types of characteristics,
you can define pseudo-operands that are equivalent
to two or more PRINTDS operands. Providing pseudo-operands makes
it easier for users to issue the PRINTDS command. Users need not
remember several PRINTDS operands. They can specify the pseudo-operand.
For
example, you could associate a pseudo-operand named PRTINV with three
PRINTDS operands. The initialization exit can scan the command buffer.
If the exit finds the pseudo-operand PRTINV, it can: - Obtain storage for a new command buffer
- Build a new command buffer and replace the pseudo-operand with
the appropriate PRINTDS operands in the new command buffer
- Update the "Key", "Length", and "Data" fields for
the new command buffer as follows:
- Key
- X'02'
- Length
- the length of the new command buffer
- Data
- the address of the new command buffer
- Set a return code of 0 and return control to the PRINTDS command processor.
You must also provide a termination exit. The termination
exit must free the storage that the initialization exit obtained for
the new command buffer.
- Monitor how long it takes the PRINTDS command to complete processing.
You
can use the initialization and termination exits to monitor the approximate
time it takes the PRINTDS command processor to complete processing. When the initialization
exit receives control, it can: - Invoke the TIME macro
- Use the exit-to-exit communication word to return the time to
the PRINTDS command processor. The exit updates the "Key", "Length",
and "Data" fields for the exit-to-exit communication word as
follows:
- Key
- X'01'
- Length
- the length of the data (time)
- Data
- the data (time)
- Set a return code of 0 and return to the PRINTDS command processor.
When the termination exit gets control, it receives the
time from the initialization exit in the exit-to-exit communication
word. Before the termination exit returns control to PRINTDS, it
can invoke the TIME macro. The exit can calculate the time difference
between the time from the initialization exit (in the exit-to-exit
communication word) and the time it receives from issuing the TIME
macro. The result is the approximate time it took the PRINTDS command
to complete its processing. The termination exit can include the processing
time in a data set. You can then periodically print the data set
and review the time calculations.
|