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

Parameters

LIB Library

Specifies which libraries are saved. Required. Up to 300 values, each a generic or specific library name, or one special value.

Type
*GENERIC
Required
Yes
Length
10
List limit
300
Case
Uppercase

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.

Type
*NAME
Required
Yes
Length
10
List limit
4
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*MOUNTED
Length
50
List limit
75
Case
Uppercase

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.

Type
*UINT4
Required
No
Default
*END
Range
1 to 16777215
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*LIB
Length
17
Case
Uppercase

Suggested / special values: *LIB

*LIB
The system creates the label from the library name.

EXPDATE File expiration date

Type
*DATE
Required
No
Default
*PERM
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*REWIND
Length
7
Case
Uppercase

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

Type
*NAME
Required
No
Default
*FIRST
Length
10
Case
Uppercase

Suggested / special values: *FIRST

SAVF Save file

Save file that contains the saved data; must be empty unless CLEAR(*ALL). Required if DEV(*SAVF).

Type
*QUAL
Required
No
Case
Uppercase
*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

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

MEDDFN Media definition

Type
*QUAL
Required
No
Case
Uppercase
Qualified parts (object, then library; write LIBRARY/OBJECT)

Media definition Media definition

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

OPTFILE Optical file

Type
*CHAR
Required
No
Default
*
Length
50
Case
Uppercase

Suggested / special values: *

USEOPTBLK Use optimum block

Type
*CHAR
Required
No
Default
*YES
Length
4
Case
Uppercase

Allowed values: *YES, *NO

TGTRLS Target release

Type
*CHAR
Required
No
Default
*CURRENT
Length
8
Case
Uppercase

Allowed values: *CURRENT, *PRV, V7R3M0, V7R4M0, V7R5M0

UPDHST Update history

Whether each saved object's save history (date, time and location) is updated.

Type
*CHAR
Required
No
Default
*YES
Length
4
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*NONE
Length
8
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*NO
Length
8
Case
Uppercase

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

Type
*ELEM
Required
No
Case
Uppercase
Elements in order

Object locks Object locks

Type
*UINT4
Required
No
Default
120
Range
0 to 99999
Case
Uppercase

Suggested / special values: *NOMAX

Pending record changes Pending record changes

Type
*UINT4
Required
No
Default
*LOCKWAIT
Range
0 to 99999
Case
Uppercase

Suggested / special values: *LOCKWAIT, *NOCMTBDY, *NOMAX

Other pending changes Other pending changes

Type
*UINT4
Required
No
Default
*LOCKWAIT
Range
0 to 99999
Case
Uppercase

Suggested / special values: *LOCKWAIT, *NOMAX

SAVACTMSGQ Save active message queue

Type
*QUAL
Required
No
Case
Uppercase
Qualified parts (object, then library; write LIBRARY/OBJECT)

Save active message queue Save active message queue

Type
*NAME
Required
No
Default
*NONE
Length
10
Case
Uppercase

Suggested / special values: *NONE, *WRKSTN

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

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.

Type
*NAME
Required
No
Default
*NONE
Length
10
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*SYSVAL
Length
7
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*YES
Length
4
Case
Uppercase

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

Type
*CHAR
Required
No
Default
*NONE
Length
5
Case
Uppercase

Allowed values: *NONE, *ALL

QDTA Queue data

Type
*CHAR
Required
No
Default
*NONE
Length
5
Case
Uppercase

Allowed values: *NONE, *DTAQ

PVTAUT Private authorities

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

Allowed values: *NO, *YES

STG Storage

Type
*CHAR
Required
No
Default
*KEEP
Length
5
Case
Uppercase

Allowed values: *KEEP, *FREE

DTACPR Data compression

Type
*CHAR
Required
No
Default
*DEV
Length
7
Case
Uppercase

Allowed values: *DEV, *NO, *YES, *LOW, *MEDIUM, *HIGH, *ZLIB

COMPACT Data compaction

Type
*CHAR
Required
No
Default
*DEV
Length
4
Case
Uppercase

Allowed values: *DEV, *NO

OMITLIB Libraries to omit

Type
*GENERIC
Required
No
Default
*NONE
Length
10
List limit
300
Case
Uppercase

Suggested / special values: *NONE, *USRSPC

OMITOBJ Objects to omit

Type
*ELEM
Required
No
Case
Uppercase
Elements in order

Object Object

Type
*QUAL
Required
No
Case
Uppercase
Qualified parts (object, then library; write LIBRARY/OBJECT)

Object Object

Type
*GENERIC
Required
No
Default
*NONE
Length
10
Case
Uppercase

Suggested / special values: *NONE, *ALL

Library Library

Type
*GENERIC
Required
No
Default
*ALL
Length
10
Case
Uppercase

Suggested / special values: *ALL

Object type Object type

Type
*CHAR
Required
No
Default
*ALL
Length
50
Case
Uppercase

Suggested / special values: *ALL

SELECT Select

Type
*ELEM
Required
No
Case
Uppercase
Elements in order

Include or omit Include or omit

Type
*CHAR
Required
No
Default
*INCLUDE
Length
8
Case
Uppercase

Allowed values: *INCLUDE, *OMIT

Object Object

Type
*QUAL
Required
No
Case
Uppercase
Qualified parts (object, then library; write LIBRARY/OBJECT)

Object Object

Type
*GENERIC
Required
No
Default
*ALL
Length
10
Case
Uppercase

Suggested / special values: *ALL

Library Library

Type
*GENERIC
Required
No
Default
*ALL
Length
10
Case
Uppercase

Suggested / special values: *ALL

Object type Object type

Type
*CHAR
Required
No
Default
*ALL
Length
50
Case
Uppercase

Suggested / special values: *ALL

Object attribute Object attribute

Type
*CHAR
Required
No
Default
*ALL
Length
50
Case
Uppercase

Suggested / special values: *ALL, *BLANK

File member File member

Type
*GENERIC
Required
No
Default
*ALL
Length
10
Case
Uppercase

Suggested / special values: *ALL, *ALLMBR

ASPDEV ASP device

Type
*NAME
Required
No
Default
*
Length
10
Case
Uppercase

Suggested / special values: *, *SYSBAS, *CURASPGRP

OUTPUT Output

Type
*CHAR
Required
No
Default
*NONE
Length
8
Case
Uppercase

Allowed values: *NONE, *PRINT, *OUTFILE

OUTFILE File to receive output

Type
*QUAL
Required
No
Case
Uppercase
Qualified parts (object, then library; write LIBRARY/OBJECT)

File to receive output File to receive output

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

OUTMBR Output member options

Type
*ELEM
Required
No
Case
Uppercase
Elements in order

Member to receive output Member to receive output

Type
*NAME
Required
No
Default
*FIRST
Length
10
Case
Uppercase

Suggested / special values: *FIRST

Replace or add records Replace or add records

Type
*CHAR
Required
No
Default
*REPLACE
Length
8
Case
Uppercase

Allowed values: *REPLACE, *ADD

INFTYPE Type of output information

Type
*CHAR
Required
No
Default
*OBJ
Length
4
Case
Uppercase

Allowed values: *OBJ, *LIB, *MBR, *ERR

CMDUSRSPC Command user space

Type
*QUAL
Required
No
Case
Uppercase
Qualified parts (object, then library; write LIBRARY/OBJECT)

Command user space Command user space

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

SORT Sort by

Type
*CHAR
Required
No
Default
*NAME
Length
5
Case
Uppercase

Allowed values: *NAME, *SIZE

ASP Emulator basic ASP filter

Type
*UINT2
Required
No
Default
*ALL
Range
1 to 32
Case
Uppercase

Suggested / special values: *ALL

IBM command documentation

Generated from os/cl/catalog/SAVLIB.json and os/cl/help/SAVLIB.json.