The Spool Distribution tool provides a solution for duplicating
spooled files with different attributes and different owners. It
allows the specifications of the distribution to be maintained in a
data base file external to the program.
The command to be used within a CL program is DUPSPLDST. A typical
command would be:
DUPSPLDST SPLF(QPRINT) SPLDSTID(AB10) SPLDSTLIB(*LIBL)
The SPLF parameter identifies the spooled file to be duplicated. It
must be a spooled file within the current job. There are no
restrictions on the type of spooled file (the TAA Tool DUPSPLF is
used which uses APIs for the duplication).
The SPLDSTID parameter identifies a record in the SPLDSTP data base
file that contains the parameters for the new spooled file. The
library containing the SPLDST objects is identified by the SPLDSTLIB
parameter.
In the data base file, each record represents a single distribution.
You can describe a different owner, a different output queue, a
different number of copies, etc.
The user who runs the DUPSPLDST command must be authorized to the
TAASPLDST authorization list.
Typical application
-------------------
Assume your program outputs a spooled file to the QPRINT printer file
and is directed to the output queue of the current job. You want a
distribution list associated with this spooled file so that the
following would occur:
** A separate copy should be owned by SMITH and duplicated to her
output queue with two copies.
** A separate copy should be owned by JONES and duplicated to his
output queue.
** A separate copy should be owned by MILLER and duplicated to
her output queue which is printed by a printer which allows
duplex printing (both sides).
** A separate copy should be made to the same output queue, but
with a different spooled file name.
A single DUPSPLDST command is needed in your program such as shown
previously. The data base file would contain 4 records for the same
SPLDSTID. Each record would specify the individual parameters that
are desired on the new spooled file.
Getting started
---------------
The CRTSPLDSTD (Create Spool Distribution Description) command
creates the objects needed for the SPLDST tool. A typical command
would be:
CRTSPLDSTD SPLDSTLIB(xxx)
The following objects are created:
- SPLDSTP physical file
- SPLDSTL logical file
- SPLDST data area
You may have multiple sets of objects, but only one set per library.
The user who runs the CRTSPLDSTD command becomes the owner of the
objects. The authority for the *PUBLIC is set to *USE.
The EDTSPLDSTD (Edit Spool Distribution Description) command
maintains the SPLDSTP file. A typical command would be:
EDTSPLDSTD SPLDSTLIB(xxx)
A subfile would be displayed with the typical options of display,
add, change, delete, copy, and rename. Each entry is uniquely
identified by a 'Spool distribution ID' (the name used on DUPSPLDST)
and a 'Spool distribution Sequence'. The Sequence value just
provides uniqueness within the spool distribution ID.
When a new record is added, the prompt appears with many of the
typical spooled file attributes as individual parameters. Most of
these default to *SAME meaning the corresponding attribute in the
spooled file to be duplicated is used.
Deleting the SPLDST objects
---------------------------
The DLTSPLDSTD command can be used by an authorized user to delete
the objects created by CRTSPLDSTD.
Error Handling and Auditing
---------------------------
If an error occurs during DUPSPLDST (such as specifying a new spooled
file owner that does not exist), the default is to send an escape
message. You may optionally ignore the error and send a message to a
specified message queue. The intent of this option is to allow the
job to continue without duplicating the spooled file.
This option controls most, but not all errors. For example, if
DUPSPLDST cannot find the SPLDSTP file, an escape message will be
sent regardless of how the option is specified.
An auditing option exists to send a journal entry to a journal
whenever DUPSPLDST is used to duplicate a spooled file. Any journal
may be used. The type sent is 'DS' and the journal code is 'U'. The
entry data contains text identifying the event.
The parameters ERRMSGQ and AUDJRN exist on the CRTSPLDSTD command to
allow you to specify the options. The options are stored in the
SPLDST data area created by CRTSPLDSTD. A separate command
CHGSPLDSTD (Change Spool Distribution Description) allows you to
change the options in the data area.
Security considerations
-----------------------
The user of the DUPSPLDST command must have *USE authority to the
TAASPLDST authorization list. If authorized, the CL program adopts
the Security Officer profile and runs the DUPSPLF TAA Tool. DUPSPLF
requires authorization to the TAADUPSPLF authorization list. It is
not necessary for the DUPSPLDST user to be authorized to TAADUPSPLF
because program adoption is used within DUPSPLDST.
The other commands are all available to the *PUBLIC. However, when
CRTSPLDSTD is used, the objects are created with *PUBLIC *USE
authority so that by default, only the owner or an authorized user
may use EDTSPLDSTD or CHGSPLDSTD.
Spooled file ownership
----------------------
The API QSPCRTSP is used by the TAA Tool DUPSPLF to create the new
spooled file.
The API requires that if a different owner is named, the owner must
be a valid user profile on the system. An internal job QPRTJOB is
created when a new owner is named and becomes the controlling job for
the spooled file.
CRTSPLDSTD command parameters *CMD
-----------------------------
SPLDSTLIB The library which will contain the spool
distribution objects.
SRCLIB The source library of the DDS source. *TAAARC is
the default to access the source from the TAA
Archive. A specific library may also be used if you
have first copied the source from the Archive to
your library. QATTDDS must be the source file name.
ERRMSGQ The error message queue to be used if errors occur
when DUPSPLDST is used. The default is *NONE which
means an escape message is sent if DUPSPLDST fails.
A qualified name of a message queue may be entered
to receive messages for error conditions. This
parameter controls most, but not all errors. For
example, if DUPSPLDST cannot find the SPLDSTP file,
an escape message will be sent even if a message
queue is specified.
This parameter may be changed by using the
CHGSPLDSTD command.
AUDJRN The journal to be used if a journal entry is
required each time DUPSPLDST duplicates a spooled
file. The default is *NONE meaning that no journal
entry is sent.
A qualified name of a journal may be entered to
cause a journal entry to be sent. Any journal (user
or system) may be used.
This parameter may be changed by using the
CHGSPLDSTD command.
EDTSPLDSTD command parameters *CMD
-----------------------------
SPLDSTID The spool distribution ID to be positioned to. If
not entered, the first name in the data base file
will appear at the top of the subfile.
SPLDSTSEQ The spool distribution sequence within the ID to be
positioned to. If not entered, the first sequence
number within the spool distribution ID will appear
at the top of the subfile.
SPLDSTLIB The library which contains the spool distribution
objects. *LIBL is the default. *CURLIB may be
used.
DUPSPLDST command parameters *CMD
----------------------------
SPLF The name of the spooled file to be duplicated. The
spooled file must be within the same job and must be
the last (or only) spooled file with the specified
name.
SPLDSTID The spool distribution ID to be used. The name
entered must exist as a record in the SPLDSTP data
base file.
SPLDSTSEQ The spool distribution sequence within the ID. The
default is *ALL meaning all records that exist with
the same SPLDSTID will be used.
SPLDSTLIB The library which contains the spool distribution
objects. *LIBL is the default. *CURLIB may be
used.
CHGSPLDSTD command parameters *CMD
-----------------------------
SPLDSTLIB The library which contains the spool distribution
objects. When the command is used interactively, it
is only necessary to name a library. A prompt
override program exists to extract the existing
values from the data area to fill the following
parameters.
ERRMSGQ The error message queue to be used if errors occur
when DUPSPLDST is used. The default is *NONE which
means an escape message is sent if DUPSPLDST fails.
A qualified name of a message queue may be entered
to receive messages for error conditions. This
parameter controls most, but not all errors. For
example, if DUPSPLDST cannot find the SPLDSTP file,
an escape message will be sent even if a message
queue is specified.
AUDJRN The journal to be used if a journal entry is
required each time DUPSPLDST duplicates a spooled
file. The default is *NONE meaning that no journal
entry is sent.
A qualified name of a journal may be entered to
cause a journal entry to be sent. Any journal (user
or system) may be used.
DLTSPLDSTD command parameters *CMD
-----------------------------
SPLDSTLIB The library which contains the spool distribution
objects to be deleted.
Restrictions
------------
The user must be authorized to the TAASPLDST authorization list.
Not all spooled file parameters are supported. However, about 20 of
the most common parameters may be specified.
Prerequisites
-------------
The following TAA Tools must be on your system:
CHKOBJ2 Check object 2
DUPSPLF Duplicate spooled file
EDTVAR Edit variable
FILEFDBCK File feedback
HLRMVMSG HLL Remove message
LOCKMSG Locked record message
RTVPGMNAM Retrieve program name
SNDCOMPMSG Send completion message
SNDESCMSG Send escape message
SNDSTSMSG Send status message
TAAARC TAA Archive
WRTSRC Write source
Implementation
--------------
The tool is ready to use, but the SPLDST objects must be created with
CRTSPLDSTD. The user of DUPSPLDST must be authorized to the
TAASPLDST authorization list.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
EDTSPLDSTD *CMD TAASPLX QATTCMD
CRTSPLDSTD *CMD TAASPLX2 QATTCMD
CHGSPLDSTD *CMD TAASPLX3 QATTCMD
DUPSPLDST *CMD TAASPLX4 QATTCMD
DLTSPLDSTD *CMD TAASPLX5 QATTCMD
TAASPLXC *PGM CLP TAASPLXC QATTCL
TAASPLXC2 *PGM CLP TAASPLXC2 QATTCL
TAASPLXC3 *PGM CLP TAASPLXC3 QATTCL
TAASPLXC4 *PGM CLP TAASPLXC4 QATTCL
TAASPLXC5 *PGM CLP TAASPLXC5 QATTCL
TAASPLXC10 *PGM CLP TAASPLXC10 QATTCL
TAASPLXC13 *PGM CLP TAASPLXC13 QATTCL
TAASPLXC14 *PGM CLP TAASPLXC14 QATTCL
TAASPLXR *PGM RPG TAASPLXR QATTRPG
TAASPLXR4 *PGM RPG TAASPLXR4 QATTRPG
TAASPLXD *FILE DSPF TAASPLXD QATTDDS
TAASPLXP *FILE PF TAASPLXP QATTDDS
TAASPLXL *FILE LF TAASPLXL QATTDDS
Structure
---------
CRTSPLDSTD Cmd
TAASPLXC2 CL pgm
EDTSPLDSTD Cmd
TAASPLXC CL pgm
TAASPLXR RPG Pgm
TAASPLXD Display file
TAASPLXC10 CL Pgm
CHGSPLDSTD Cmd
TAASPLXC3 CL pgm
TAASPLXC13 CL prompt override pgm
DUPSPLDST Cmd
TAASPLXC4 CL pgm
TAASPLXR4 RPG pgm
TAASPLXC14 CL pgm
DLTSPLDSTD Cmd
TAASPLXC5 CL pgm
|