Command reference / save

SAVCHGOBJ

Save Changed Objects

The Save Changed Object (SAVCHGOBJ) command saves a copy of each changed object or group of objects located in the same library. When *ALL is specified for the Objects (OBJ) parameter, objects can be saved from all user libraries or from a list of libraries. When saving to a save file, only one library can be specified. For database files, only the changed members are saved. Objects changed since the specified date and time are saved with the following exceptions: If OBJJRN(*NO) is specified, objects currently being journaled are not saved, unless journaling was started after the specified date and time. This ensures that changes made to an object before journaling starts are not lost (because they were not journaled in a journal receiver). Freed objects (programs, files, journal receivers, and so forth) are not saved. User-defined messages, job and output queue definitions, and logical file definitions are saved, but the contents of those objects are not saved. Logical file access paths are saved if ACCPTH(*YES) is specified. The contents of a data queue can be saved by specifying *DTAQ for the Queue data (QDTA) parameter. Specified objects that were changed and the libraries where they reside remain locked during the save operation. Saved objects can be restored with the Restore Object (RSTOBJ) command. To determine the date and time that an object was changed, run the Display Object Description (DSPOBJD) command with DETAIL(*FULL) specified. For database file members that were changed, run the Display File Description (DSPFD) command. The types of objects that can be saved by this command are listed in the OBJTYPE parameter description in "Commonly used parameters: Expanded descriptions" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/. The system saves the changed objects by writing a copy of each one on tapes, optical volumes, or a save file. The description of each object is changed with the date, time, and place when it was last saved and is controlled by the UPDHST parameter. Note: This command ignores all file overrides currently in effect for the job, except for the output file.

Allowed environments: *ALL. Positional parameters: 5.

Restrictions

Parameters

OBJ Objects

Specifies the names of one or more objects, or the generic names of each group of objects, to check for changes and then to save those objects that have changed. All the objects must be in the library specified for the Library (LIB) parameter. If *ALL is specified or defaulted for the Object types (OBJTYPE) parameter, all the object types listed in the description of that parameter are saved, provided they are in the specified library and have the specified names. This is a required parameter.

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

Suggested / special values: *ALL

*ALL
All changed objects in the specified libraries are saved, depending on the values specified for the OBJTYPE parameter.
generic-name
Specify one or more generic names of groups of changed objects to save in the specified library. A generic name is a character string that contains one or more characters followed by an asterisk (*). If an * is not specified with the name, the system assumes that the name is a complete object name.
name
Specify the names of specific objects to save. Both generic names and specific names can be specified in the same command.

LIB Library

Specifies the library that contains the changed objects to be saved. Note: Libraries are saved alphabetically by ASP device name for each value specified. Libraries on independent ASPs are saved before libraries on the system and basic user ASPs. For value *ALLUSR, libraries QSYS2, QGPL, QUSRSYS, and QSYS2xxxxx (where xxxxx is an independent ASP number) are saved first, if they are located on the ASPs specified by the ASPDEV parameter. This is a required parameter.

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

Suggested / special values: *SELECT, *USRSPC

*ALLUSR
All user libraries are saved. All libraries with names that do not begin with the letter Q are saved except for the following: #CGULIB #DSULIB #SEULIB #COBLIB #RPGLIB #DFULIB #SDALIB Although the following Qxxx libraries are provided by IBM, they typically contain user data that changes frequently. Therefore, these libraries are considered "user libraries", and are also saved: QDSNX QRCLxxxxx QUSRDIRDB QUSRVI QGPL QSRVAGT QUSRIJS QUSRVxRxMx QGPL38 QSYS2 QUSRINFSKR QWQCENT QMGTC QSYS2xxxxx QUSRNOTES QWQREPOS QMGTC2 QS36F QUSROND QMPGDATA QUSER38 QUSRPOSGS QMQMDATA QUSRADSM QUSRPOSSA QMQMPROC QUSRBRM QUSRPYMSVR QPFRDATA QUSRDIRCF QUSRRDARS QRCL QUSRDIRCL QUSRSYS Note: A different library name, in the format QUSRVxRxMx, can be created by the user for each previous release supported by IBM to contain any user commands to be compiled in a CL program for the previous release. For the QUSRVxRxMx user library, VxRxMx is the version, release, and modification level of a previous release that IBM continues to support.
*SELECT
The libraries identified in the Select (SELECT) parameter are saved. Only one library can be specified in the selection criteria when saving to a save file. Special value *SPLF cannot be specified in the selection criteria.
*USRSPC
The libraries identified in the user space specified for the Command user space (CMDUSRSPC) parameter are saved. Only one library can be specified in the user space when saving to a save file. Special value *SPLF cannot be specified in the user space.
generic-name
Specify the generic name of the library. A generic name is a character string of one or more characters followed by an asterisk (*); for example, ABC*. The asterisk (*) substitutes for any valid characters. A generic name specifies all libraries with names that begin with the generic prefix, for which the user has authority. If an asterisk is not included with the generic (prefix) name, the system assumes it to be the complete library name. A generic library name cannot be specified when saving to a save file.
name
If *ALL is specified for the Objects (OBJ) parameter, up to 300 library names can be specified. Only one library can be specified when saving to a save file.

DEV Device

Specifies the name of the device used for the save operation. The device name must already be known on the system by a device description. This is a required parameter.

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

Suggested / special values: *SAVF, *MEDDFN

*SAVF
The save operation is done using the save file specified for the Save file (SAVF) parameter.
*MEDDFN
The save operation is done using the devices and media identified in the media definition specified for the Media definition (MEDDFN) parameter.
optical-device-name
Specify the name of the optical device used for the save operation.
tape-media-library-device-name
Specify the name of the tape media library device used for the save operation.
tape-device-name
Specify the names of one or more tape devices used for the save operation. If a virtual tape device is used, it must be the only device specified. If multiple tape devices are used, they must have compatible media formats and their names must be specified in the order in which they are used. Using more than one tape device permits one tape volume to be rewound and unloaded while another tape device processes the next tape volume. To use more than one device in parallel, a media definition must be specified.

OBJTYPE Object types

Specifies the types of system objects whose changes are saved. The object types saved are also the ones saved and restored by the Save Library (SAVLIB), Restore Object (RSTOBJ), and Restore Library (RSTLIB) commands. Data dictionaries and the associated files are saved only by using the SAVLIB command.

Type
*CHAR
Required
No
Default
*ALL
Length
50
List limit
300
Case
Uppercase

Suggested / special values: *ALL

*ALL
Changes to all object types that are specified by name, and which are in the specified library, are saved.
object-type
Specify the value for each of the types of objects that are saved, such as command (*CMD), file (*FILE), or program (*PGM). To see a complete list of object types when prompting this command, position the cursor on the field for this parameter and press F4 (Prompt). For a description of the object types, see "Object types" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.

OBJJRN Objjrn

Specifies whether to save changed objects that are currently being journaled and that have been journaled since the date and time specified for the Reference date (REFDATE) and Reference time (REFTIME) parameters.

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

Allowed values: *NO, *YES

*NO
Objects being journaled are not saved. If journaling was started after the specified date and time, the changed objects or changed database file members are saved. The date and time of the last journal start operation can be shown by using the Display Object Description (DSPOBJD) command.
*YES
Objects whose changes are entered in a journal are saved.

REFDATE Refdate

Specifies the reference date. Objects that have been changed since this date are saved.

Type
*DATE
Required
No
Default
*SAVLIB
Case
Uppercase

Suggested / special values: *SAVLIB

*SAVLIB
The objects that have been changed since the date of the last running of the Save Library (SAVLIB) command are saved. If the specified library was never saved, a message is issued and the library is not saved, but the operation continues.
date
Specify the reference date; objects that have been changed since this date are saved. If you specify a date later than the date of the running of this command, a message is issued and the operation ends. The date must be specified in the job date format.

REFTIME Reftime

Specifies the reference time. Objects that have been changed since this time on the specified date are saved.

Type
*TIME
Required
No
Default
*NONE
Case
Uppercase

Suggested / special values: *NONE

*NONE
No explicit time is specified. Any objects changed since the date specified for the Reference date (REFDATE) parameter are saved.
time
Specify the reference time; objects that have been changed since this time on the specified date are saved. If *SAVLIB is specified for the REFDATE parameter, no reference time can be specified. If you specify a time later than the time of the running of this command, a message is issued and the operation ends. The time can be specified with or without a time separator: Without a time separator, specify a string of 6 digits (hhmmss) where hh = hours, mm = minutes, and ss = seconds. With a time separator, specify a string of 8 digits where the time separator specified for your job is used to separate the hours, minutes, and seconds. If you enter this command from the command line, the string must be enclosed in apostrophes. If a time separator other than the separator specified for your job is used, this command will fail.

VOL Volume identifier

Specifies the volume identifiers of the volumes, or the cartridge identifiers of tapes in a tape media library device, on which the data is saved. The volumes must be placed in the device in the same order as specified for this parameter.

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

Suggested / special values: *MOUNTED

*MOUNTED
The data is saved on the volumes placed in the device. For a media library device, the volume to be used is the next cartridge in the category mounted by the Set Tape Category (SETTAPCGY) command. Note: This value cannot be specified when using an optical media library device.
character-value
Specify the identifiers of one or more volumes in the order in which they are placed in a device and used to save the data.

SEQNBR Sequence number

Specifies, when tape is used, the sequence number to use as the starting point for the save operation.

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

Suggested / special values: *END

*END
The save operation begins after the last sequence number on the first tape. If the first tape is full, an error message is issued and the operation ends.
1-16777215
Specify the sequence number of the file to be used for the save operation.

LABEL Label

Specifies the name that identifies the data file on the tape volume that is to be used for the save operation. If this parameter is used on the save command, the same label must be specified on the restore command. Note: You cannot specify *SAVLIB on this parameter, since it is a special value for the Label (LABEL) parameter of the restore command and would prevent you from restoring what you saved.

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

Suggested / special values: *LIB

*LIB
The file label is created by the system using the name of the library specified for the Library (LIB) parameter.
character-value
Specify the data file identifier of the data file used for the save operation. A maximum of 17 characters can be used. This option is valid only for a single-library save operation.

EXPDATE File expiration date

Specifies the expiration date of the file created by the save operation. If a date is specified, the file is protected and cannot be overwritten until the specified expiration date. This parameter is valid for tape and optical files. Specifying this parameter does not protect against a later save operation specifying CLEAR(*ALL).

Type
*DATE
Required
No
Default
*PERM
Case
Uppercase

Suggested / special values: *PERM

*PERM
The file is protected permanently.
date
Specify the date when protection for the file ends.

ENDOPT End of media option

Specifies the operation that is automatically done on the tape or optical volume after the save operation ends. If more than one volume is used, this parameter applies only to the last volume used; all other volumes are unloaded when the end of the volume is reached. Note: This parameter is valid only if a tape or optical device name is specified for the DEV parameter. For optical devices, *UNLOAD is the only special value supported, *REWIND and *LEAVE will be ignored.

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

Allowed values: *REWIND, *LEAVE, *UNLOAD

*REWIND
The tape is automatically rewound, but not unloaded, after the operation has ended.
*LEAVE
The tape does not rewind or unload after the operation ends. It remains at the current position on the tape drive.
*UNLOAD
The tape is automatically rewound and unloaded after the operation ends. Some optical devices will eject the volume after the operation ends.

SAVF Save file

Specifies the save file that is used to contain the saved data. The save file must be empty, unless *ALL is specified for the Clear (CLEAR) parameter. Note: A value must be specified for this parameter if *SAVF is specified for the Device (DEV) parameter.

Type
*QUAL
Required
No
Case
Uppercase
Qualifier 1: Save file: name
Specify the name of save file to be used.
Qualifier 2: Library: name
Specify the name of the library where the save file is located.
*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the thread is used to locate the save file. If no current library entry exists in the library list, the QGPL library is used.
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

Specifies the media definition (*MEDDFN) object that identifies the devices and media used to contain the saved data. For information about creating and using a media definition, see the Recovering your system book, SC41-5304, and the Create Media Definition API in the APIs topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/. If a media definition is specified, the VOL, SEQNBR, SAVF, and OPTFILE parameters cannot be specified. The volume identifiers and sequence numbers are specified in the media definition.

Type
*QUAL
Required
No
Case
Uppercase
Qualifier 1: Media definition: name
Specify the name of the media definition to be used.
Qualifier 2: Library: name
Specify the name of the library to be searched.
*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the thread is searched. If no library is specified as the current library for the thread, the QGPL library is searched.
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

Specifies the path name of the optical file that is used for the save operation, beginning with the root directory of the volume. For more information on specifying path names, refer to "Object naming rules" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.

Type
*CHAR
Required
No
Default
*
Length
50
Case
Uppercase

Suggested / special values: *

*
The system generates an optical file name in the root directory of the optical volume.
'optical-directory-path-name/*'
The system generates an optical file name in the specified directory of the optical volume.
'optical-file-path-name'
Specify the path name of the optical file.

USEOPTBLK Use optimum block

Specifies whether or not the optimum block size is used for the save operation. Note: Specifying USEOPTBLK(*YES) may result in a tape that can be duplicated only to a device that supports the same block size.

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

Allowed values: *YES, *NO

*YES
The optimum block size supported by the device is used for Save commands. If the block size that is used is larger than a block size that is supported by all device types, then: Performance may improve. The tape file that is created is only compatible with a device that supports the block size used. Commands such as Duplicate Tape (DUPTAP) do not duplicate files unless the files are being duplicated to a device which supports the same block size that was used. The value for the DTACPR parameter is ignored.
*NO
The optimum block size supported by the device is not used. Save commands use the default block size supported by all device types. The tape volume can be duplicated to any media format using the Duplicate Tape (DUPTAP) command.

TGTRLS Target release

Specifies the release of the operating system on which you intend to restore and use the object. When specifying the target-release value, the format VxRxMx is used to specify the release, where Vx is the version, Rx is the release, and Mx is the modification level. For example, V5R3M0 is version 5, release 3, modification 0. Valid values depend on the current version, release, and modification level of the operating system, and they change with each new release. You can press F4 while prompting this command parameter to see a list of valid target release values. To specify that an object be saved for distribution to a system at a different release level than the system on which the save operation is to occur, the procedure differs for program or non-program objects and by the release level on which a program object is created. If, for example, you are saving an object for distribution to a target system running on an earlier release, you have the following choices: For program objects: If the program object was created at a release level more current than the targeted earlier release, you must: create the program object again specifying the targeted earlier release save the program object specifying the targeted earlier release restore the program object on the target system. If the program object was created at the same release level as the target system, you can: save the program object specifying the targeted earlier release restore the program object on the target system. For non-program objects: You can: save the object specifying the targeted earlier release restore the object on the target system. If LIB(*ALLUSR) is specified, only the current release can be the target release. Not all objects can be targeted to another release. To find out which objects are supported, see the chart in the Recovering your system book, SC41-5304.

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

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

*CURRENT
The object is to be restored to, and used on, the release of the operating system currently running on your system. The object can also be restored to a system with any subsequent release of the operating system installed.
*PRV
The object is to be restored to the previous release with modification level 0 of the operating system. The object can also be restored to a system with any subsequent release of the operating system installed.
character-value
Specify the release in the format VxRxMx. The object can be restored to a system with the specified release or with any subsequent release of the operating system installed.

UPDHST Update history

Specifies whether the save history information of each saved object is changed with the date, time, and location of this save operation. The save history information for an object is displayed using the Display Object Description (DSPOBJD) command. The save history information is used to determine which journal entries are processed when RCVRNG(*LASTSAVE) and FROMENT(*LASTSAVE) or FROMENTLRG(*LASTSAVE) are used on the Apply Journaled Changes (APYJRNCHG) command.

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

Allowed values: *YES, *NO

*YES
The last save date, time, and location is updated in each object saved.
*NO
The save history information contained in the description of each object saved is not updated. Note: UPDHST(*NO) should be used for a save operation that is not intended for recovery. For example, if the save data is sent, record by record, to another system and the save file immediately deleted, the save history information is probably not to be updated.

CLEAR Clear

Specifies whether active data on the media is automatically cleared or replaced. Active data is any file on the media that has not expired. For saves to tape, clearing active data will make any files on the tape volume beyond the last file written by the save operation no longer accessible. For saves to optical, the files written by the save operation can be automatically replaced while other files on the volume remain active, or all active files can be automatically cleared. Clearing does not erase the data, it just makes the files no longer accessible. Clearing a tape does not initialize it. You should initialize tapes to a standard label format before the save command is issued by using the Initialize Tape (INZTAP) command and specifying a value for the NEWVOL parameter. Clearing an optical volume does initialize it. If a volume that is not initialized is encountered during the save operation, an inquiry message is sent and an operator can initialize the volume. If tapes are used and a sequence number is specified for the SEQNBR parameter, the first tape is cleared beginning at that sequence number. All tapes following that first tape are completely cleared. To clear the entire first tape, SEQNBR(1) must be specified.

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

Allowed values: *NONE, *ALL, *AFTER, *REPLACE

*NONE
None of the media is automatically cleared. If the save operation encounters active data on a tape volume or in a save file, an inquiry message is sent, allowing the operator to either end the save operation or clear the media. If the save operation encounters the specified optical file, an inquiry message is sent, allowing the operator to either end the save operation or replace the file.
*ALL
All of the media is automatically cleared.
*AFTER
All media after the first volume is automatically cleared. If the save operation encounters active data on the first tape volume, an inquiry message is sent, allowing the operator to either end the save operation or clear the media. If the save operation encounters the specified optical file on the first volume, an inquiry message is sent, allowing the operator to either end the save operation or replace the file.
*REPLACE
Active data on the media is automatically replaced. Optical volumes are not initialized. Other media is automatically cleared in the same way as the *ALL value.

PRECHK Object pre-check

Specifies whether the save operation for a library ends if any of the following are true: The objects do not exist The library or the objects were previously found to be damaged The library or the objects are locked by another job The requester of the save operation does not have authority for the library or to save the objects.

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

Allowed values: *NO, *YES

*NO
The save operation for a library continues, saving only those objects that can be saved.
*YES
If, after all specified objects are checked, one or more objects cannot be saved, the save operation for a library ends before any data is written. If multiple libraries are specified, the save operation continues with the next library. However, if PRECHK(*YES) and SAVACT(*SYNCLIB) are specified and an object in any library to be saved does not meet the preliminary check conditions, the save operation ends and no objects are saved.

SAVACT Save active

Specifies whether an object can be updated while it is being saved. Note: If your system is in a restricted state and the SAVACT parameter is specified, the save operation is performed as if SAVACT(*NO) was specified.

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

Allowed values: *NO, *LIB, *SYNCLIB, *SYSDFN

*NO
Objects that are in use are not saved. Objects cannot be updated while being saved.
*LIB
Objects in a library can be saved while they are in use by another job. All of the objects in a library reach a checkpoint together and are saved in a consistent state in relationship to each other.
*SYNCLIB
Objects in a library can be saved while they are in use by another job. All of the objects and all of the libraries in the save operation reach a checkpoint together and are saved in a consistent state in relationship to each other. Note: If you specify this value and you are saving many libraries, it can take a long time to reach a checkpoint for all of the objects and libraries in the save operation.
*SYSDFN
Objects in a library can be saved while they are in use by another job. Objects in a library may reach checkpoints at different times and may not be in a consistent state in relationship to each other.

SAVACTWAIT Save active wait time

Specifies the amount of time to wait for an object that is in use, or for transactions with pending changes to reach a commit boundary, before continuing the save operation. For each object that is in use, specifies the amount of time to wait for the object to become available. If an object remains in use for the specified time, the object is not saved. For each group of objects that are checkpointed together, specifies the amount of time to wait for transactions with pending record changes to reach a commit boundary. The Save active (SAVACT) parameter determines which objects are checkpointed together. If 0 is specified, all objects being saved must be at commit boundaries. If any other value is specified, all objects that are journaled to the same journals as the objects being saved must reach commit boundaries. If a commit boundary is not reached in the specified time, the save operation is ended, unless the value *NOCMTBDY is specified. For each library, specifies the amount of time to wait for transactions with other pending changes to reach a commit boundary. Other pending changes include the following: Data Definition Language (DDL) object level changes for that library. Any API commitment resource that was added without the option to allow normal save processing. For more information, see the Add Commitment Resource (QTNADDCR) API in the APIs topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/. If a commit boundary is not reached for a library in the specified time, the library is not saved.

Type
*ELEM
Required
No
Case
Uppercase
120
The system waits up to 120 seconds for each individual object lock before continuing the save operation.
Element 1: Object locks: *NOMAX
No maximum wait time exists.
Element 1: Object locks: 0-99999
Specify the number of seconds to wait for each individual object lock before continuing the save operation.
Element 2: Pending record changes: *LOCKWAIT
The system waits up to the value specified for Element 1 for transactions with pending record changes to reach a commit boundary.
*NOCMTBDY
The system will save objects without requiring transactions with pending record changes to reach a commit boundary. Therefore, objects may be saved with partial transactions. If you restore an object that was saved with partial transactions, you cannot use the object until you apply or remove journal changes (APYJRNCHG or RMVJRNCHG command) to reach commit boundaries. You will need all journal receivers that contain information about the partial transactions to apply or remove the changes. Until you apply or remove the changes, any future save of that object will include the partial transactions, even if you do not specify *NOCMTBDY.
Element 2: Pending record changes: *NOMAX
No maximum wait time exists.
Element 2: Pending record changes: 0-99999
Specify the number of seconds to wait for transactions with pending record changes to reach a commit boundary.
Element 3: Other pending changes: *LOCKWAIT
The system waits up to the value specified for Element 1 for the types of transactions that are listed above to reach a commit boundary.
Element 3: Other pending changes: *NOMAX
No maximum wait time exists.
Element 3: Other pending changes: 0-99999
Specify the number of seconds to wait for the types of transactions that are listed above to reach a commit boundary.
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

Specifies the message queue that the save operation uses to notify the user that the checkpoint processing for a library is complete. A separate message is sent for each library to be saved when the *SYSDFN or *LIB value is specified for the Save active (SAVACT) parameter. When *SYNCLIB is specified for the SAVACT parameter, one message is sent for all libraries in the save operation. This parameter can be used to save the objects at a known, consistent boundary to avoid additional recovery procedures following a restore operation. Applications can be stopped until the checkpoint processing complete message is received.

Type
*QUAL
Required
No
Case
Uppercase
*NONE
No notification message is sent.
*WRKSTN
The notification message is sent to the work station message queue. This value is not valid in batch mode.
Qualifier 1: Save active message queue: name
Specify the name of the message queue to be used.
Qualifier 2: Library: name
Specify the name of the library where the message queue is located.
*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is used to locate the message queue. If no library is specified as the current library for the job, the QGPL library is used.
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

Specifies the name of the synchronized checkpoint in which this save while active operation will participate. The synchronized checkpoint must already be started by the Start Save Synchronization (STRSAVSYNC) command.

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

Suggested / special values: *NONE

*NONE
The checkpoint for this save while active operation is not synchronized with any other save while active operation.
name
Specify the name of the synchronized checkpoint. If you specify a name, you must also specify a value of *SYNCLIB for the Save active (SAVACT) parameter. Note: If you specify a name, the value used for the Save active wait time (SAVACTWAIT) parameter Element 2: Pending record changes is the largest value specified among all of the participating save operations. However, if any participating save operation specifies *NOCMTBDY, then all participating save operations must specify *NOCMTBDY.

FILEMBR File member

Type
*ELEM
Required
No
Case
Uppercase
Elements in order

File File

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

Suggested / special values: *ALL

Member Member

Type
*GENERIC
Required
No
Default
*ALL
Length
10
List limit
50
Case
Uppercase

Suggested / special values: *ALL, *NONE

ACCPTH Save access paths

Specifies whether the logical file access paths that are dependent on the physical files being saved are also saved. The access paths are saved only in the case of the following: All members on which the access paths are built are included in this save operation. The access paths are not invalid or damaged at the time of the save. The system checks to ensure the integrity of the access paths. Any discrepancies found by the system will result in the access paths being rebuilt. Informational messages are sent indicating the number of logical file access paths saved with each physical file. All physical files on which an access path is built must be in the same library. This parameter does not save logical file objects; it only controls the saving of the access paths. More information on the restoring of saved access paths is in the Recovering your system book, SC41-5304. ATTENTION: If the based-on physical files and the logical files are in different libraries, the access paths are saved. However, if the logical files and the based-on physical files are in different libraries and the logical files or physical files do not exist at restore time (such as during disaster recovery or the files were deleted) the access paths are not restored. They are rebuilt. For the fastest possible restore operation for logical files, the logical files and the based-on physical files must be in the same library and must be saved at the same time.

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

Allowed values: *SYSVAL, *NO, *YES

*SYSVAL
The QSAVACCPTH system value determines whether to save the logical file access paths that are dependent on the physical files that are being saved.
*NO
Only those objects specified on the command are saved. No logical file access paths are saved.
*YES
The specified physical files and all eligible logical file access paths over them are saved. Note: Specifying this value does not save the logical files.

SAVFDTA Save file data

Specifies, for save file objects, whether the description of a save file, or both the description and the contents of a save file, 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 a save file is saved.

SPLFDTA Spooled file data

Specifies whether to save spooled file data and attributes for output queues that are saved.

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

Allowed values: *NONE, *ALL

*NONE
No spooled file data is saved.
*NEW
For each output queue that is saved, spooled file data created since the Reference date (REFDATE) and Reference time (REFTIME) is saved. Output queues that have spooled files created after the Reference date and Reference time will be considered changed and will be saved. Spooled files with creation dates and times before the Reference date and Reference time, which have been moved to an output queue will not be saved and the output queue will not be considered to be changed.

QDTA Queue data

Specifies, for queue objects, whether the description of a queue, or both the description and the contents of a queue, are saved.

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

Allowed values: *NONE, *DTAQ

*NONE
Only the description of a queue is saved.
*DTAQ
The description and contents of a standard data queue are saved. Only the description of a Distributed Data Management (DDM) data queue is saved.

PVTAUT Private authorities

Specifies whether to save private authorities with the objects that are saved. Saving private authorities will increase the amount of time it takes to save the objects, but it can simplify the recovery of an object or a group of objects. It will not simplify the recovery of an entire system.

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

Allowed values: *NO, *YES

*NO
No private authorities are saved.
*YES
Private authorities are saved for each object that is saved. Note: You must have save system (*SAVSYS) or all object (*ALLOBJ) special authority to specify this value.

STG Storage

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

Allowed values: *KEEP, *FREE

DTACPR Data compression

Specifies whether data compression is used. If the save is running while other jobs on the system are active and software compression is used, the overall system performance may be affected. Note: If *DEV is specified for both this parameter and the Data compaction (COMPACT) parameter, only device data compaction is performed if device data compaction is supported on the device. Otherwise, data compression is performed. If *YES is specified for this parameter and *DEV is specified for the COMPACT parameter, both device data compaction and device data compression are performed if supported on the device.

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

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

*DEV
If the save is to tape and the target device supports compression, hardware compression is performed. Otherwise, no data compression is performed.
*NO
No data compression is performed.
*YES
If the save is to tape and the target device supports compression, hardware compression is performed. If compression is not supported, or if the save data is written to optical media or to a save file, software compression is performed. Low software compression is used for all devices except optical DVD, which uses medium software compression.
*LOW
If the save operation is to a save file or optical, software data compression is performed with the SNA algorithm. Low compression is usually faster and the compressed data is usually larger than if medium or high compression is used.
*MEDIUM
If the save operation is to a save file or optical, software data compression is performed with the TERSE algorithm. Medium compression is usually slower than low compression but faster than high compression. The compressed data is usually smaller than if low compression is used and larger than if high compression is used.
*HIGH
If the save operation is to a save file or optical, software data compression is performed with the LZ1 algorithm. High compression is usually slower and the compressed data is usually smaller than if low or medium compression is used.
*ZLIB
If the save operation is to a save file or optical, software data compression is performed using the ZLIB deflate algorithm.

COMPACT Data compaction

Specifies whether device data compaction is performed.

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

Allowed values: *DEV, *NO

*DEV
Device data compaction is performed if the data is saved to tape and all tape devices specified for the Device (DEV) parameter support the compaction feature. Note: If *DEV is specified for both the Data compression (DTACPR) parameter and this parameter, only device data compaction is performed if device data compaction is supported on the device. Otherwise, data compression is performed if supported on the device. If *YES is specified for the DTACPR parameter and *DEV is specified for this parameter, both device data compaction and device data compression are performed if supported on the device.
*NO
Device data compaction is not performed.

OMITLIB Libraries to omit

Specifies the names of one of more libraries, or the generic names of each group of libraries, to be excluded from the save operation.

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

Suggested / special values: *NONE, *USRSPC

*NONE
No libraries are excluded from the save operation.
*USRSPC
The libraries identified in the user space specified for the Command user space (CMDUSRSPC) parameter are excluded from the save operation.
generic-name
Specify the generic name of the libraries to be excluded. A generic name is a character string of one or more characters followed by an asterisk (*); for example, ABC*. The asterisk (*) substitutes for any valid characters. A generic name specifies all libraries with names that begin with the generic prefix, for which the user has authority. If an asterisk is not included with the generic (prefix) name, the system assumes it to be the complete library name.
name
Specify the name of the library to be excluded from the save operation.

OMITOBJ Objects to omit

Specifies the objects to be excluded from the operation. Up to 300 objects or generic object values can be specified.

Type
*ELEM
Required
No
Case
Uppercase
*USRSPC
The objects identified in the user space specified for the Command user space (CMDUSRSPC) parameter are excluded from the save operation.
Qualifier 1: Object: *NONE
No objects are excluded from the operation.
Qualifier 1: Object: *ALL
All objects of the specified object type are excluded from the operation.
Qualifier 1: Object: generic-name
Specify the generic name of the objects to be excluded. Note: A generic name is specified as a character string that contains one or more characters followed by an asterisk (*). If a generic name is specified, then all objects that have names with the same prefix as the generic object name are selected.
Qualifier 1: Object: name
Specify the name of the object to be excluded from the operation.
Qualifier 2: Library: *ALL
The specified objects are excluded from all libraries that are part of the operation.
Qualifier 2: Library: generic-name
Specify the generic name of the libraries that contain objects to be excluded. Note: A generic name is specified as a character string that contains one or more characters followed by an asterisk (*). If a generic name is specified, then all objects that have names with the same prefix as the generic object name are selected.
Qualifier 2: Library: name
Specify the name of the library that contains the object to be excluded from the operation.
Element 2: Object type: *ALL
All object types are excluded from the operation, depending on the value specified for the object name.
character-value
Specify the object type of the objects to be excluded from the operation. To see a complete list of object types when prompting this command, position the cursor on the field for this parameter and press F4 (Prompt). For a description of the object types, see "Object types" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
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

Specifies the selection criteria for the objects to be saved. You can select from the objects specified for the Objects (OBJ), Library (LIB), and Object types (OBJTYPE) parameters. Specifies whether the selected objects should be included or omitted from the save operation. Specifies the database file members to select. If *ALL is specified, the objects selected by the previous elements are included or omitted. If any value other than *ALL is specified, the objects selected by the previous elements are included, even if the objects are not database files. If the objects selected are database files, the file members selected are included or omitted.

Type
*ELEM
Required
No
Case
Uppercase
*USRSPC
The selection criteria identified in the user space specified for the Command user space (CMDUSRSPC) parameter is used.
*INCLUDE
The selected objects are saved, unless overridden by an *OMIT specification, or unless omitted by the Libraries to omit (OMITLIB) parameter or the Objects to omit (OMITOBJ) parameter.
*OMIT
The selected objects are not included in the save operation.
Qualifier 1: Object: *ALL
All object names specified for the Objects (OBJ) parameter are selected.
Qualifier 1: Object: generic-name
Specify the generic name of the objects to be selected. Note: A generic name is specified as a character string that contains one or more characters followed by an asterisk (*). If a generic name is specified, then all objects that have names with the same prefix as the generic object name are selected.
Qualifier 1: Object: name
Specify the name of the object to be selected.
Qualifier 2: Library: *ALL
All library names specified for the Library (LIB) parameter are selected.
Qualifier 2: Library: generic-name
Specify the generic name of the libraries to be selected.
Qualifier 2: Library: name
Specify the name of the library to be selected.
Element 3: Object type: *ALL
All object types specified for the Object types (OBJTYPE) parameter are selected.
character-value
Specify the object type to be selected. To see a complete list of object types when prompting this command, position the cursor on the field for this parameter and press F4 (Prompt). For a description of the object types, see "Object types" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
Element 4: Object attribute: *ALL
All object attributes are selected.
*BLANK
Only objects that have no attribute value are selected.
attribute-value
Specify the attribute of the objects to be selected.
generic-attribute-value
Specify the generic attribute of the objects to be selected.
Element 5: File member: *ALL
All file members are selected. For an *OMIT specification, the selected file or object is also omitted.
*ALLMBR
All file members are selected. For an *OMIT specification, the selected file or object is included and all file members are omitted.
Element 5: File member: generic-name
Specify the generic name of the file members to be selected. The selected file or object is included even if it does not contain the specified members.
Element 5: File member: name
Specify the name of the file member to be selected. The selected file or object is included even if it does not contain the specified member.
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

Specifies the auxiliary storage pool (ASP) device to be included in the save operation. This parameter is used to subset the list of objects which qualify for the SAV based on the OBJ parameter.

Type
*NAME
Required
No
Default
*
Length
10
Case
Uppercase

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

*
The operation includes the system ASP (ASP number 1), all basic user ASPs (ASP numbers 2-32), and, if the current thread has an ASP group, all independent ASPs in the ASP group.
*SYSBAS
The system ASP and all basic user ASPs are included in the save operation.
*CURASPGRP
If the current thread has an ASP group, all independent ASPs in the ASP group are included in the save operation.
name
Specify the name of the ASP device to be included in the save operation.

OUTPUT Output

Specifies whether a list with information about the saved objects is created. The information can be printed with the job's spooled output or directed to a database file.

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

Allowed values: *NONE, *PRINT, *OUTFILE

*NONE
No output listing is created.
*PRINT
The output is printed with the job's spooled output.
*OUTFILE
The output is directed to the database file specified for the File to receive output (OUTFILE) parameter.

OUTFILE File to receive output

Specifies the database file to which the output of the command is directed. If the file does not exist, this command creates a database file in the specified library. If the file is created, the public authority for the file is the same as the create authority specified for the library in which the file is created. Use the Display Library Description (DSPLIBD) command to show the library's create authority. Note: If a new file is created, the system uses the IBM-supplied file QASAVOBJ with format name QSRSAV as a model.

Type
*QUAL
Required
No
Case
Uppercase
Qualifier 1: File to receive output: name
Specify the name of the database file to which the command output is directed.
Qualifier 2: Library: name
Specify the name of the library to be searched.
*LIBL
The library list is used to locate the file. If the file is not found, one is created in the current library. If no current library exists, the file will be created in the QGPL library.
*CURLIB
The current library for the thread is used to locate the file. If no library is specified as the current library for the thread, the QGPL library is used.
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

Specifies the name of the database file member to which the output is directed when *OUTFILE is specified for the Output (OUTPUT) parameter.

Type
*ELEM
Required
No
Case
Uppercase
*FIRST
The first member in the file receives the output. If OUTMBR(*FIRST) is specified and the member does not exist, the system creates a member with the name of the file specified for the File to receive output (OUTFILE) parameter.
name
Specify the name of the file member that receives the output. If OUTMBR(member-name) is specified and the member does not exist, the system creates it. If the member exists, you can add records to the end of the existing member or clear the existing member and add the records.
*REPLACE
The existing records in the specified database file member are replaced by the new records.
*ADD
The new records are added to the existing information in the specified database file member.
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

Specifies the type of information which is printed or directed to the database file.

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

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

*OBJ
The list contains an entry for each object requested to be saved.
*ERR
The list contains information about the command, an entry for each library, and an entry for each object that was not successfully saved.
*LIB
The list contains a library entry for each library requested to be saved
*MBR
The list contains an entry for each object, database file member, and spooled file requested to be saved.

CMDUSRSPC Command user space

Specifies a user space containing the values for the parameters which have *USRSPC specified for this command. The user space allows up to 32767 list values for each parameter, while the command parameters only allow up to 300 list values. The user space must define the parameters in the format used by the Save Object List (QSRSAVO) API.

Type
*QUAL
Required
No
Case
Uppercase
Qualifier 1: User space: name
Specify the name of the user space containing the values for the parameters which have *USRSPC specified for this command.
Qualifier 2: Library: name
Specify the name of the library where the user space is located.
*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is used to locate the user space. If no library is specified as the current library for the job, the QGPL library is used.
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

Examples

SAVCHGOBJ OBJ(ORD*) LIB(DSTPRODLB) DEV(TAP01) OBJTYPE(*FILE) REFDATE(122290)

Saving Changed Files. This command saves all files with names that start with the characters ORD in the library named DSTPRODLB that were changed since December 22, 1990.

SAVCHGOBJ OBJ(FILE*) LIB(MYLIB) DEV(TAP01) OBJTYPE(*FILE) REFDATE(122290) SAVFDTA(*YES)

Saving Description and Data for Save Files. This command saves all files with names that start with the characters FILE* in the library named MYLIB that were changed since December 22, 1990. It also saves the description and the data for all save files that match this selection criteria.

IBM command documentation

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