Command reference / save
SAVLIB
Save Library
Saves a copy of one or more libraries, including the library description, object descriptions, and object contents. Saving to a save file allows only one library. Job queues, message queues and logical files have only their definitions saved. Access paths, spooled file data, save file contents and data queue contents can be included through the ACCPTH, SPLFDTA, SAVFDTA and QDTA parameters. Libraries and objects are not changed unless storage is to be freed, but each saved object's and library's description is updated with the save date, time and place unless UPDHST(*NO). Saving a group of libraries via *NONSYS, *ALLUSR or *IBM also updates history in data areas in QSYS. Certain operating system objects, such as user profiles, are not saved; use SAVSYS or SAVSECDTA for them. File overrides are ignored except for the output file.
The source help entry is marked incomplete.
Allowed environments: *ALL.
Positional parameters: 3.
Restrictions
- Requires either *SAVSYS special authority, or *READ authority to (or ownership of) each library and *OBJEXIST authority to each object in it (for spooled file data, *OBJEXIST on the output queue).
- Without *SAVSYS, only the libraries and objects you have authority for are saved.
- Saving to tape or optical requires *USE authority to the device description.
- Saving to a save file requires *ADD and *USE authority to the save file.
- Using a media definition requires *USE authority to it and *EXECUTE authority to its library.
- No library being saved, or its objects, can be updated by a running job during the save unless save-while-active is used.
- When a save file's contents are saved into the same save file with SAVFDTA(*YES), only the save file description is saved.
- When a save file's contents are saved with SAVFDTA(*YES), the save file must be restored before the objects in it can be restored.
- Using CMDUSRSPC requires *USE authority to the user space and *EXECUTE authority to its library.
Parameters
LIB
Library
Specifies which libraries are saved. Required. Up to 300 values, each a generic or specific library name, or one special value.
Suggested / special values:
*NONSYS, *ALLUSR, *IBM, *SELECT, *USRSPC
*NONSYS- All libraries except system libraries such as QSYS, QSPL, QSRV, QTEMP and QRECOVERY. All subsystems must be ended first.
*ALLUSR- All user libraries: names not beginning with Q, plus IBM Q-libraries that hold user data (for example QGPL and QUSRSYS).
*IBM- All IBM-supplied libraries except a listed set of user-data libraries; the #-prefixed libraries are included.
*SELECT- Libraries identified in the SELECT parameter are saved; only one library when saving to a save file.
*USRSPC- Libraries listed in the user space named by CMDUSRSPC are saved.
DEV
Device
Device used for the save. The device name must already exist as a device description. Required.
Suggested / special values:
*SAVF, *MEDDFN
*SAVF- The save file named in SAVF is used.
*MEDDFN- The devices and media in the media definition named in MEDDFN are used.
VOL
Volume identifier
Volume identifiers, or tape media library cartridge identifiers, for the save, in the order they are placed in the device.
Suggested / special values:
*MOUNTED
*MOUNTED- Data is saved to the volumes placed in the device; for a media library, the next cartridge in the category set by SETTAPCGY.
SEQNBR
Sequence number
For tape, the sequence number to start the save at.
Suggested / special values:
*END
*END- The save begins after the last sequence number on the first tape; an error ends the operation if that tape is full.
LABEL
Label
Data file identifier on tape that must be specified again on restore. Up to 17 characters; valid only for single-library saves.
Suggested / special values:
*LIB
*LIB- The system creates the label from the library name.
EXPDATE
File expiration date
Suggested / special values:
*PERM
ENDOPT
End of media option
Operation done on the tape or optical volume after the save. Valid only for tape or optical devices.
Allowed values:
*REWIND, *LEAVE, *UNLOAD
*REWIND- The tape is rewound but not unloaded.
*LEAVE- The tape is neither rewound nor unloaded.
*UNLOAD- The tape is rewound and unloaded.
STRLIB
Starting library
Suggested / special values:
*FIRST
SAVF
Save file
Save file that contains the saved data; must be empty unless CLEAR(*ALL). Required if DEV(*SAVF).
*LIBL- Qualifier 2: all libraries in the library list are searched.
*CURLIB- Qualifier 2: the current library is used; QGPL if none is set.
Qualified parts (object, then library; write LIBRARY/OBJECT)
Save file
Save file
Library
Library
Suggested / special values:
*LIBL, *CURLIB
MEDDFN
Media definition
Qualified parts (object, then library; write LIBRARY/OBJECT)
Media definition
Media definition
Library
Library
Suggested / special values:
*LIBL, *CURLIB
OPTFILE
Optical file
Suggested / special values:
*
USEOPTBLK
Use optimum block
Allowed values:
*YES, *NO
TGTRLS
Target release
Allowed values:
*CURRENT, *PRV, V7R3M0, V7R4M0, V7R5M0
UPDHST
Update history
Whether each saved object's save history (date, time and location) is updated.
Allowed values:
*YES, *NO
*YES- The last save date, time and location are updated in each saved object.
*NO- The save history in each saved object's description is not updated.
CLEAR
Clear
Whether active data on the media is automatically cleared or replaced. Active data is any unexpired file on the media.
Allowed values:
*NONE, *ALL, *AFTER, *REPLACE
*NONE- Nothing is cleared; if active data is encountered, an inquiry message lets the operator end the save or clear the media.
*ALL- All of the media is automatically cleared.
*AFTER- All media after the first volume is automatically cleared; an inquiry message may be sent for active data on the first volume. Not valid for save files.
*REPLACE- Active data is automatically replaced; optical volumes are not initialized; other media are cleared as with *ALL.
PRECHK
Object pre-check
Whether the library save ends if objects do not exist, are damaged or locked, or the requester lacks authority.
Allowed values:
*NO, *YES
*NO- The save continues, saving only the objects that can be saved.
*YES- If any object cannot be saved, the library save ends before any data is written.
SAVACT
Save active
Whether objects can be updated while being saved.
Allowed values:
*NO, *LIB, *SYNCLIB, *SYSDFN
*NO- Objects in use are not saved; objects cannot be updated during the save.
*LIB- Objects in use can be saved; all objects in a library reach a checkpoint together.
*SYNCLIB- Objects and libraries in the save reach a checkpoint together.
*SYSDFN- Objects can be saved while in use; they may reach checkpoints at different times and may not be consistent with each other.
SAVACTWAIT
Save active wait time
Elements in order
Object locks
Object locks
Suggested / special values:
*NOMAX
Pending record changes
Pending record changes
Suggested / special values:
*LOCKWAIT, *NOCMTBDY, *NOMAX
Other pending changes
Other pending changes
Suggested / special values:
*LOCKWAIT, *NOMAX
SAVACTMSGQ
Save active message queue
Qualified parts (object, then library; write LIBRARY/OBJECT)
Save active message queue
Save active message queue
Suggested / special values:
*NONE, *WRKSTN
Library
Library
Suggested / special values:
*LIBL, *CURLIB
SYNCID
Synchronization ID
Name of the synchronized checkpoint this save-while-active operation participates in. The checkpoint must already be started by STRSAVSYNC, and SAVACT(*SYNCLIB) must be specified.
Suggested / special values:
*NONE
*NONE- The checkpoint is not synchronized with any other save-while-active operation.
ACCPTH
Save access paths
Whether logical file access paths dependent on the physical files being saved are also saved. Logical file objects themselves are not saved.
Allowed values:
*SYSVAL, *NO, *YES
*SYSVAL- The QSAVACCPTH system value determines whether access paths are saved.
*NO- Only the specified objects are saved; no access paths.
*YES- The specified physical files and all eligible access paths over them are saved.
SAVFDTA
Save file data
For save file objects, whether the description, or both the description and contents, are saved.
Allowed values:
*YES, *NO
*YES- The description and contents of a save file are saved.
*NO- Only the description of the save file is saved.
SPLFDTA
Spooled file data
Allowed values:
*NONE, *ALL
QDTA
Queue data
Allowed values:
*NONE, *DTAQ
PVTAUT
Private authorities
Allowed values:
*NO, *YES
STG
Storage
Allowed values:
*KEEP, *FREE
DTACPR
Data compression
Allowed values:
*DEV, *NO, *YES, *LOW, *MEDIUM, *HIGH, *ZLIB
COMPACT
Data compaction
Allowed values:
*DEV, *NO
OMITLIB
Libraries to omit
Suggested / special values:
*NONE, *USRSPC
OMITOBJ
Objects to omit
Elements in order
Object
Object
Qualified parts (object, then library; write LIBRARY/OBJECT)
Object
Object
Suggested / special values:
*NONE, *ALL
Library
Library
Suggested / special values:
*ALL
Object type
Object type
Suggested / special values:
*ALL
SELECT
Select
Elements in order
Include or omit
Include or omit
Allowed values:
*INCLUDE, *OMIT
Object
Object
Qualified parts (object, then library; write LIBRARY/OBJECT)
Object
Object
Suggested / special values:
*ALL
Library
Library
Suggested / special values:
*ALL
Object type
Object type
Suggested / special values:
*ALL
Object attribute
Object attribute
Suggested / special values:
*ALL, *BLANK
File member
File member
Suggested / special values:
*ALL, *ALLMBR
ASPDEV
ASP device
Suggested / special values:
*, *SYSBAS, *CURASPGRP
OUTPUT
Output
Allowed values:
*NONE, *PRINT, *OUTFILE
OUTFILE
File to receive output
Qualified parts (object, then library; write LIBRARY/OBJECT)
File to receive output
File to receive output
Library
Library
Suggested / special values:
*LIBL, *CURLIB
OUTMBR
Output member options
Elements in order
Member to receive output
Member to receive output
Suggested / special values:
*FIRST
Replace or add records
Replace or add records
Allowed values:
*REPLACE, *ADD
INFTYPE
Type of output information
Allowed values:
*OBJ, *LIB, *MBR, *ERR
CMDUSRSPC
Command user space
Qualified parts (object, then library; write LIBRARY/OBJECT)
Command user space
Command user space
Library
Library
Suggested / special values:
*LIBL, *CURLIB
SORT
Sort by
Allowed values:
*NAME, *SIZE
ASP
Emulator basic ASP filter
Suggested / special values:
*ALL
Generated from os/cl/catalog/SAVLIB.json and os/cl/help/SAVLIB.json.