The Save Library to Save Files command saves one or more libraries to
save files in a specified library. Special values exist and
libraries may be omitted. Save files are created if they do not
exist using the name as the library to be saved. The intent of
SAVLIBSAVF is to allow you to save to a library of save files that
can then be backed up to media at a later time. The companion
command DLTLIBSAVF will delete the created save files.
The library of the save files must exist. For the simplest use, no
other objects should exist in the library except those created by
A typical command would be:
SAVLIBSAVF LIB(*ALLUSR) SAVFLIB(xxx)
All libraries saved by the *ALLUSR function of SAVLIB would be saved
with the exception of the ZZZ library and any library beginning with
the letters YY.
SAVLIBSAVF will not save a library if:
** A file object exists in the SAVFLIB which has the same name as
the library to be saved, but is not a save file.
** A save file object exists in the SAVFLIB which has the same
name as the library to be saved, but the save file was not
created by SAVLIBSAVF.
** The library to be saved is the same name as the SAVFLIB
Deleting some or all of the save file data
After the backup to media occurs, you may choose to delete some or
all of the save files. Assume you are you using the simplest
solution where the backup library contains only those objects created
** If you do not want to keep any of the data online, use the
** If you want to keep one or more of the save files on line, use
the DLTLIBSAVF TAA command (see later discussion). This will
let you delete all of the save files except those specified on
an omit list. You may also delete by using specific names or
generic save file names.
SAVLIBSAVF error handling
The default for SAVLIBSAVF is to use the CHKSAVRST TAA command with
ERRORSONLY(*YES). This will provide a listing of any save errors.
Other errors may appear in the job log such as where a save file
exists, but was not created by SAVLIBSAVF.
DLTLIBSAVF allows you to delete one or more save files created by
SAVLIBSAVF. Only save files created by SAVLIBSAVF will be deleted by
DLTLIBSAVF. An omit list is also provided. DLTLIBSAVF is helpful
when you do not want to delete all the save files in a backup
Assume you run SAVLIBSAVF and saved several libraries to save files
in library BACKUP. After saving the BACKUP library to tape, you now
want to delete the save files of data except for the XXX* libraries
and the YYY library.
DLTLIBSAVF SAVF(*ALL) SAVFLIB(BACKUP) +
All the save files created by SAVLIBSAVF except those on the omit
list would be deleted.
A typical use of DLTLIBSAVF is if you are using SAVLIBSAVF to backup
all or most libraries. After saving the backup library, you want to
keep the libraries associated with a critical application on line.
This will allow you to recover quickly without restoring from offline
Keeping source libraries on line is also a good choice because
restoring a single member from an online save file is a much simpler
process than attempting to restore from tape.
The simplest solution using SAVLIBSAVF is to have a specific library
for the save files. No other objects should exist in the library.
If you want to delete all the save files and only save files exist, a
better solution would be to use CLRLIB.
Using unique saves to save files in the same library
In some cases you may want to save most libraries to a backup library
(assume the name is BACKUP) using SAVLIBSAVF. You would use the
OMITLIB parameter for one or more libraries that you want to save
with your own unique save operation.
Your unique save operation could be to save files in the BACKUP
library. This would allow you to issue one SAVLIB command to write
the BACKUP library to offline media.
Using this approach, DLTLIBSAVF will not delete the save files that
were created by your unique commands. Use either CLRLIB or a
combination of 1) DLTLIBSAVF for the SAVLIBSAVF created save files,
and 2) DLTF for the unique save files you created.
SAVLIBSAVF escape messages you can monitor for
TAA9891 One or more errors occurred.
Escape messages from based on functions will be re-sent.
DLTLIBSAVF escape messages you can monitor for
TAA9892 Some error occurred.
Escape messages from based on functions will be re-sent.
SAVLIBSAVF command parameters *CMD
LIB A list of up to 300 library names or generic library
names to be saved. The special values *ALLUSR,
*ALLUSR2, or *IBM may be entered.
The definition of *ALLUSR and *IBM are the same as
that used on SAVLIB.
*ALLUSR2 is similar to *ALLUSR. It omits the same #
libraries, but also omits any library beginning with
Q. Note that if you have your own library which
begins with Q, it is omitted.
SAVFLIB The library to contain the save files. The library
The simplest solution is to have a specific library
devoted to SAVLIBSAVF so that the only objects in
the library are created by SAVLIBSAVF.
If a library is to be saved and the save file does
not exist, the save file will be created. If a save
file exists with the name of the library and it was
created by SAVLIBSAVF, the save file is cleared
If the save file was not created by SAVLIBSAVF, the
library will not be saved.
OMITLIB A list of up to 300 library names or generic names
to be omitted. The SAVFLIB library is always
LIBTYPE Whether to select all or a specified library type.
*ALL is the default to select all types.
*PROD may be used to select only production (PROD)
*TEST may be used to select only test (TEST)
UPDHST Whether to update the Save/Restore history
information. *YES is the default to update the
*NO may be specified to not update the information.
ACCPTH Whether to save access paths or not. The default is
*SYSVAL which uses the contents of the system value
QSAVACCPTH (system default causes *YES).
*YES may be specified to save access paths. A *NO
entry does not save the access paths.
SPLFDTA Whether to save spooled file data or not. The
default is *NONE meaning no spooled file data is
*ALL may be specified to save the spooled file data.
An object will exist in the save for each output
QDTA Whether to save data queue data or not. The default
is *NONE meaning no data queue data will be saved.
*DTAQ may be specified to save the data queues and
their data. An object will exist in the save for
each data queue.
PVTAUT Whether to save the private authorities to the
objects. The default is *NO meaning no private
authorities are saved.
*YES may be specified to save the private
SAVFDTA Whether to save the SAVF object data. The default
is *YES. An entry of *NO will cause the SAVF
objects to be saved without the save file data.
DTACPR Whether to use data compress. The values are passed
thru to the SAVLIB command. For a complete
understanding of the parameter, see the SAVLIB
The default is *YES to compress the data.
*NO may be specified so the data will not be
*LOW may be specified to compress to a low degree.
*MEDIUM may be specified to compress to a medium
*HIGH may be specified to compress to a high degree.
BGNLIB Beginning library to start at. The default is
*FIRST. This is designed as a testing or recovery
function if a SAVLIBSAVF is interrupted. The value
entered is used to compare against each library name
to be saved. If the library name is less than the
value, the library is bypassed.
CHKSAVRST A *YES/*NO option for should the TAA Tool CHKSAVRST
command be run. The default is *YES. The CHKSAVRST
command will produce a spooled file of all the S/R
messages which have occurred during the job. When
the SAVLIBSAVF command begins and ends, a message is
sent to the job log with the TAA9878 message. This
will be picked up by the CHKSAVRST command to assist
you in determining which messages belong to the
ERRORSONLY A *YES/*NO option for should the CHKSAVRST command
ERRORSONLY option be used. *YES is the default.
The default is designed to further 'net out' the job
log. The printed listing will essentially take the
library completion message information and print a
summary. If any objects were not saved, the detail
message will appear in the job log if the *YES
option is taken. The entry is ignored if
CHKSAVRST(*NO) is specified.
OUTPUT Whether a list of information about the saved
objects should be output to a print file or an
output file. The default is *NONE. See also the
*PRINT may be specified to output to a spooled file
named QPSAVOBJ. Because each save file can only
contain a single library, a unique spooled file is
created for each library that is saved.
*OUTFILE may be specified to output to the file
named in the OUTFILE parameter.
OUTFILE The name of the file to be used for output if
OUTPUT(*OUTFILE) is specified. The model file used
is QASAVOBJ in QSYS with a format name of QSRSAV.
The file will be created if it does not exist in the
named library. The qualified library name defaults
to *LIBL, but requires that the file exist with the
same format as QASAVOBJ. *CURLIB may also be
OUTMBR A 2 part parameter that specifies the member and
whether the member is cleared first if
OUTPUT(*OUTFILE) is specified.
The first part of the parameter is the member name
which defaults to *FIRST.
The second part of the parameter determines whether
the member is cleared first. The default is
*REPLACE meaning the existing data is cleared first
before writing data. Because only a single library
may exist in a save file, the value is used only on
the first library that is saved. The *ADD function
is used for any additional libraries that are saved.
*ADD may be specified to add records to the output
INFTYPE The type of information that is output if
OUTPUT(*PRINT) or OUTPUT(*OUTFILE) is specified.
*OBJ is the default and outputs a record for each
object and library saved.
*LIB may be specified to output a record for each
*MBR may be specified to output a record for each
library and object saved along with any members
saved for each object.
*ERR may be specified to output a record for each
library and object that was successfully saved along
with command information.
DLTLIBSAVF command parameters *CMD
SAVF A list of up to 300 save file names or generic save
file names to be deleted. The special value *ALL
may be entered for all save files. Only those save
files created by SAVLIBSAVF will be deleted.
SAVFLIB The library where the save files exist.
OMITSAVF A list of up to 300 save file names or generic names
that are to be omitted (not deleted). The default
The following TAA Tools must be on your system:
CHGOBJD2 Check object description 2
CHKGENERC Check generic
CHKGENOBJ Check generic object
CHKSAVRST Check save/restore
EDTVAR Edit variable
EXTLST Extract list
EXTLST2 Extract list 2
RSNLSTMSG Resend last message
SNDCOMPMSG Send completion message
SNDDIAGMSG Send diagnostic message
SNDESCINF Send escape information
SNDESCMSG Send escape message
SNDJLGMSG Send job log message
SNDSTSMSG Send status message
None, the tool is ready to use.
Objects used by the tool
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
SAVLIBSAVF *CMD TAASAWB QATTCMD
DLTLIBSAVF *CMD TAASAWB2 QATTCMD
TAASAWBC *PGM CLP TAASAWBC QATTCL
TAASAWBC2 *PGM CLP TAASAWBC2 QATTCL
TAASAWBC11 *PGM CLP TAASAWBC11 QATTCL