Save Restore Changed Objects (SAVRSTCHG)

The Save/Restore Changed Object (SAVRSTCHG) command saves and concurrently restores a copy of each changed object, or group of objects located in the same library, to another system. For database files, only the changed members are saved and restored. Objects or members changed since the specified date and time are saved and restored.

Objects changed since the specified date and time are saved and restored with the following exceptions:

Specified objects that were changed, and the libraries where they reside, remain locked during the save and restore operation.

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 and restored 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 and concurrently restores the changed objects.

Restrictions:

  1. To use this command, the user must have the special authority *SAVSYS specified in the user profile by the SPCAUT parameter. Otherwise, the user must have object existence authority for each object specified, and execute authority to the specified library. If the user does not have the necessary authority to a specified object, all changed objects except that object are saved and restored.
  2. No changed object that is being saved and restored can be changed by a job that is running when the save and restore operation occurs unless save-while-active is used.
  3. When the contents of a save file are saved with SAVFDTA(*YES), the save file must be restored before objects contained in it can be restored.
  4. Both systems intended to participate in the save and restore operation must be connected to the same APPN network or, if the OptiConnect for IBM i option is to be used, both systems must be joined by the OptiConnect for IBM i hardware and software.

Parameters

Keyword Description Choices Notes
OBJ Objects Single values: *ALL
Other values (up to 300 repetitions): Generic name, name
Required, Positional 1
LIB Saved library Single values: *ALLUSR
Other values (up to 300 repetitions): Generic name, name
Required, Positional 2
RMTLOCNAME Remote location name Name Required, Positional 3
OBJTYPE Object types Single values: *ALL
Other values (up to 73 repetitions): *ALRTBL, *BNDDIR, *CHTFMT, *CLD, *CLS, *CMD, *CRG, *CRQD, *CSI, *CSPMAP, *CSPTBL, *DTAARA, *DTAQ, *EDTD, *EXITRG, *FCT, *FILE, *FNTRSC, *FNTTBL, *FORMDF, *FTR, *GSS, *IGCDCT, *IGCSRT, *IGCTBL, *IMGCLG, *JOBD, *JOBQ, *JOBSCD, *JRN, *JRNRCV, *LOCALE, *MEDDFN, *MENU, *MGTCOL, *MODULE, *MSGF, *MSGQ, *NODGRP, *NODL, *ORTBL, *OUTQ, *OVL, *PAGDFN, *PAGSEG, *PDFMAP, *PDG, *PGM, *PNLGRP, *PRDAVL, *PRTIMG, *PSFCFG, *QMFORM, *QMQRY, *QRYDFN, *RCT, *SBSD, *SCHIDX, *SPADCT, *SQLPKG, *SQLUDT, *SQLXSR, *SRVPGM, *SSND, *SVRSTG, *S36, *TBL, *USRIDX, *TIMZON, *USRQ, *USRSPC, *VLDL, *WSCST
Optional
OBJJRN Journaled objects *NO, *YES Optional
REFDATE Reference date Date, *SAVLIB Optional
REFTIME Reference time Time, *NONE Optional
STRLIB Starting library Name, *FIRST Optional
OMITLIB Libraries to omit Single values: *NONE
Other values (up to 300 repetitions): Generic name, name
Optional
OMITOBJ Objects to omit Values (up to 300 repetitions): Element list Optional
Element 1: Object Qualified object name
Qualifier 1: Object Generic name, name, *ALL, *NONE
Qualifier 2: Library Generic name, name, *ALL
Element 2: Object type Character value, *ALL, *ALRTBL, *BNDDIR, *CHTFMT, *CLD, *CLS, *CMD, *CRG, *CRQD, *CSI, *CSPMAP, *CSPTBL, *DTAARA, *DTAQ, *EDTD, *EXITRG, *FCT, *FILE, *FNTRSC, *FNTTBL, *FORMDF, *FTR, *GSS, *IGCDCT, *IGCSRT, *IGCTBL, *JOBD, *JOBQ, *JOBSCD, *JRN, *JRNRCV, *LOCALE, *MEDDFN, *MENU, *MGTCOL, *MODULE, *MSGF, *MSGQ, *M36, *M36CFG, *NODGRP, *NODL, *ORTBL, *OUTQ, *OVL, *PAGDFN, *PAGSEG, *PDFMAP, *PDG, *PGM, *PNLGRP, *PRDAVL, *PSFCFG, *QMFORM, *QMQRY, *QRYDFN, *RCT, *SBSD, *SCHIDX, *SPADCT, *SQLPKG, *SQLUDT, *SQLXSR, *SRVPGM, *SSND, *SVRSTG, *S36, *TIMZON, *TBL, *USRIDX, *USRQ, *USRSPC, *VLDL, *WSCST
SELECT Select Values (up to 300 repetitions): Element list Optional
Element 1: Include or omit *INCLUDE, *OMIT
Element 2: Object Qualified object name
Qualifier 1: Object Generic name, name, *ALL
Qualifier 2: Library Generic name, name, *ALL
Element 3: Object type Character value, *ALL, *ALRTBL, *BNDDIR, *CHTFMT, *CLD, *CLS, *CMD, *CRG, *CRQD, *CSI, *CSPMAP, *CSPTBL, *DTAARA, *DTAQ, *EDTD, *EXITRG, *FCT, *FILE, *FNTRSC, *FNTTBL, *FORMDF, *FTR, *GSS, *IGCDCT, *IGCSRT, *IGCTBL, *JOBD, *JOBQ, *JOBSCD, *JRN, *JRNRCV, *LOCALE, *MEDDFN, *MENU, *MGTCOL, *MODULE, *MSGF, *MSGQ, *NODGRP, *NODL, *ORTBL, *OUTQ, *OVL, *PAGDFN, *PAGSEG, *PDFMAP, *PDG, *PGM, *PNLGRP, *PRDAVL, *PSFCFG, *QMFORM, *QMQRY, *QRYDFN, *RCT, *SBSD, *SCHIDX, *SPADCT, *SQLPKG, *SQLUDT, *SQLXSR, *SRVPGM, *SSND, *SVRSTG, *S36, *TBL, *USRIDX, *USRQ, *USRSPC, *VLDL, *WSCST
Element 4: Object attribute Character value, *ALL, *BLANK
Element 5: File member Generic name, name, *ALL, *ALLMBR
ASPDEV ASP device Name, *, *SYSBAS, *CURASPGRP Optional
TGTRLS Target release Simple name, *CURRENT, *PRV Optional
PRECHK Object pre-check *NO, *YES Optional
SAVACT Save active *NO, *LIB, *SYSDFN Optional
SAVACTWAIT Save active wait time Element list Optional
Element 1: Object locks 0-99999, 120, *NOMAX
Element 2: Pending record changes 0-99999, *LOCKWAIT, *NOCMTBDY, *NOMAX
Element 3: Other pending changes 0-99999, *LOCKWAIT, *NOMAX
SAVACTMSGQ Save active message queue Qualified object name Optional
Qualifier 1: Save active message queue Name, *NONE, *WRKSTN
Qualifier 2: Library Name, *LIBL, *CURLIB
ACCPTH Save access paths *SYSVAL, *NO, *YES Optional
SAVFDTA Save file data *YES, *NO Optional
SPLFDTA Spooled file data *NONE, *NEW Optional
QDTA Queue data *NONE, *DTAQ Optional
PVTAUT Private authorities *NO, *YES Optional
RSTLIB Restore to library Name, *LIB Optional
RSTASPDEV Restore to ASP device Name, *SAVASPDEV Optional
RSTASP Restore to ASP number 1-32, *SAVASP Optional
OPTION Option *ALL, *NEW, *OLD Optional
MBROPT Data base member option *MATCH, *ALL, *NEW, *OLD Optional
ALWOBJDIF Allow object differences Single values: *NONE, *ALL, *COMPATIBLE
Other values (up to 4 repetitions): *AUTL, *FILELVL, *OWNER, *PGP
Optional
FRCOBJCVN Force object conversion Single values: *SYSVAL, *NO
Other values: Element list
Optional
Element 1: Convert during restore *YES
Element 2: Objects to convert *RQD, *ALL
STRJRN Start journaling *YES, *NO Optional

Objects (OBJ)

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.

Single values

*ALL
All changed objects in the specified libraries are saved, depending on the values specified for the OBJTYPE parameter.

Other values (up to 300 repetitions)

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.

Saved library (LIB)

Specifies the library that contains the changed objects to be saved and restored.

Single values

*ALLUSR
All user libraries are saved and restored. All libraries with names that do not begin with the letter Q are saved and restored 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 and restored:

QDSNX       QRCLxxxxx   QUSRDIRDB   QUSRVI
QGPL        QSRVAGT     QUSRIJS     QUSRVxRxMx
QGPL38      QSYS2       QUSRINFSKR
QMGTC       QSYS2xxxxx  QUSRNOTES
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.

Other values (up to 300 repetitions)

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. Up to 300 generic library values can be specified.
name
Specify the name of the library to be saved and restored. Up to 300 library names can be specified.

Remote location (RMTLOCNAME)

Specifies the remote location to connect with. Specify the remote location name using the format cccccccc or nnnnnnnn.cccccccc, where nnnnnnnn is the network identifier (ID) and cccccccc is the remote location name.

remote-location-name
Specify the remote location name associated with the system to which you want to restore objects. The local network ID (LCLNETID) network attribute is used as the value of the network identifier.
network-ID.location-name
Specify the network identifier and the remote location name associated with the system to which you want to restore objects.

Object types (OBJTYPE)

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.

Single values

*ALL
Changes to all object types that are specified by name, and which are in the specified library, are saved.

Other values (up to 300 repetitions)

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/.

Journaled objects (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.

*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.

Reference date (REFDATE)

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

*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.

Reference time (REFTIME)

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

*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.

Starting library (STRLIB)

Specifies the library with which to begin the *ALLUSR save. This parameter is used to recover from ended or failed *ALLUSR save operations.

*FIRST
The save operation begins with the first library in alphabetical order.
name
Specify the name of the library with which to begin the save.

Libraries to omit (OMITLIB)

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

Single values

*NONE
No libraries are excluded from the save operation.

Other values (up to 300 repetitions)

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.

Objects to omit (OMITOBJ)

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

Element 1: Object

Qualifier 1: Object

*NONE
No objects are excluded from the operation.
*ALL
All objects of the specified object type are excluded from the operation.
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.

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.
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.

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/.

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.

Element 1: Include or omit

Specifies whether the selected objects should be included or omitted from the save operation.

*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.

Element 2: Object

Qualifier 1: Object

*ALL
All object names specified for the Objects (OBJ) parameter are selected.
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.

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.
generic-name
Specify the generic name of the libraries to be selected.
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

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.

*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.
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.
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.

ASP device (ASPDEV)

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.

*
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.

Target release (TGTRLS)

Specifies the release level of the operating system on which you intend to use the object being saved.

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.

*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.

Object pre-check (PRECHK)

Specifies whether the save operation for a library ends if any of the following are true:

  1. The objects do not exist
  2. The library or the objects were previously found to be damaged
  3. The library or the objects are locked by another job
  4. The requester of the save operation does not have authority for the library or to save the objects.
*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.

Save active (SAVACT)

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.

*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 the objects in a library reach a checkpoint together and are saved in a consistent state in relationship to each other.
*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.

Save active wait time (SAVACTWAIT)

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.

Element 1: Object locks

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.

120
The system waits up to 120 seconds for each individual object lock before continuing the save operation.
*NOMAX
No maximum wait time exists.
0-99999
Specify the number of seconds to wait for each individual object lock before continuing the save operation.

Element 2: Pending record changes

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.

*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.

*NOMAX
No maximum wait time exists.
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

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:

If a commit boundary is not reached for a library in the specified time, the library is not saved.

*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.
*NOMAX
No maximum wait time exists.
0-99999
Specify the number of seconds to wait for the types of transactions that are listed above to reach a commit boundary.

If 0 is specified, and only one name is specified for the Objects (OBJ) parameter, and *FILE is the only value specified for the Object types (OBJTYPE) parameter, the system will save the object without requiring the types of transactions that are listed above to reach a commit boundary.

Save active message queue (SAVACTMSGQ)

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.

Single values

*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

*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.
name
Specify the name of the library where the message queue is located.

Save access paths (ACCPTH)

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:

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.

*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.

Save file data (SAVFDTA)

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.

*YES
The description and contents of a save file are saved.
*NO
Only the description of a save file is saved.

Spooled file data (SPLFDTA)

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

*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.

Queue data (QDTA)

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

*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.

Private authorities (PVTAUT)

Specifies whether to save and restore private authorities with the objects that are saved and restored.

*NO
No private authorities are saved or restored.
*YES
Private authorities are saved and restored with the objects.

Note: You must have save system (*SAVSYS) or all object (*ALLOBJ) special authority on the system from which objects are being saved, and *ALLOBJ special authority on the restore system, to specify this value.

Restore to library (RSTLIB)

Specifies the name of the library to which the objects are restored.

*LIB
The restore library is the same name as the value specified on the LIB parameter.
name
Specify the name of the library to which the objects are restored.

Restore to ASP device (RSTASPDEV)

Specifies the auxiliary storage pool (ASP) device to which the data is to be restored.

Note: You can specify either the RSTASPDEV parameter or the RSTASP parameter, but not both.

*SAVASPDEV
The data is restored to the same ASP from which it was saved.
name
Specify the name of the ASP device to be used.

Restore to ASP number (RSTASP)

Specifies whether objects are restored to the auxiliary storage pool (ASP) from which they were saved or to the system ASP (ASP number 1) or to a basic user ASP (ASP numbers 2 through 32).

Some objects cannot be restored to user ASPs. More information about object types which can be restored to user ASPs is in the Recovering your system book, SC41-5304. If the library exists in, or is being restored to the system ASP, journals, journal receivers, and save files can be restored to basic user ASPs. All other object types will be restored to the ASP of the library.

ATTENTION: System or product libraries (libraries that begin with a Q or #) must not be created in or restored to a user ASP. Doing so can cause unpredictable results.

*SAVASP
The objects are restored to the ASP from which they were saved.
1-32
Specifies the ASP number. When the specified ASP is 1, the specified objects are restored to the system ASP, and when the specified ASP is 2 through 32, the objects are restored to the basic user ASP specified.

Option (OPTION)

Specifies how to handle restoring each object.

*ALL
All the objects in the saved library are restored to the library. Objects in the saved library replace the current versions in the system library. Objects not having a current version are added to the system library. Objects presently in the library, but not on the media, remain in the library.
*NEW
Only the objects in the saved library that do not exist in the current version of the system library are added to the library. Only objects not known to the system library are restored; known objects are not restored. This option restores objects that were deleted after they were saved or that are new to this library. If any saved objects have a version already in the system library, they are not restored, and an informational message is sent for each one, but the restore operation continues.
*OLD
Only the objects in the library having a saved version are restored; that is, the version of each object currently in the library is replaced by the saved version. Only objects known to the library are restored. If any saved objects are no longer part of the online version of the library, they are not added to the library; an informational message is sent for each one, but the restore continues.
*FREE
The saved objects are restored only if they exist in the system library with their space freed. The saved version of each object is restored on the system in its previously freed space. This option restores objects that had their space freed when they were saved. If any saved objects are no longer part of the current version of the library, or if the space is not free for any object, the object is not restored and an informational message is sent for each one. The restore operation continues, and all of the freed objects are restored.

Data base member option (MBROPT)

Specifies, for database files that exist on the system, which members are restored. If *MATCH is used, the member list in the saved file must match, member for member, the current version on the system. All members are restored for files that do not exist, if the file is restored.

*MATCH
The saved members are restored if the lists of the members where they exist match, member for member, the lists of the current system version. MBROPT(*MATCH) is not valid when *ALL is specified for the Allow object differences (ALWOBJDIF) parameter.
*ALL
All members in the saved file are restored.
*NEW
Only new members (members not known to the system) are restored.
*OLD
Only members already known to the system are restored.

Allow object differences (ALWOBJDIF)

Specifies whether differences are allowed between the saved objects and the restored objects.

Notes:

  1. You must have all object (*ALLOBJ) special authority to specify any value other than *NONE for this parameter.
  2. If differences are found, the final message for the restore operation is an escape message rather than the normal completion message.

The types of differences include:

Single values

*NONE
None of the differences listed above are allowed on the restore operation. See the description of each individual value to determine how differences are handled.
*COMPATIBLE
All of the differences listed above are allowed on the restore operation. See the description of each individual value to determine how differences are handled. This value allows differences that are compatible with existing database files. This value is usually preferable to the value *ALL which also allows differences that are not compatible with existing database files.
*ALL
All of the differences listed above are allowed on the restore operation. File level id and member level id differences are handled differently than the *FILELVL value. If there is a file level difference and *ALL is specified for the Data base member option (MBROPT) parameter, the existing version of the file is renamed and the saved version of the file is restored. If there is a member level difference, the existing version of the member is renamed and the saved version of the member is restored. This value will restore the saved data, but the result may not be correct. You will need to choose whether the restored data or the renamed data is correct, and you will need to make the necessary corrections to the database. For other differences, see the description of each individual value to determine how differences are handled.

Other values (up to 4 repetitions)

*AUTL
Authorization list differences are allowed. If the saved object had an authorization list and the object exists on the system but does not have the same authorization list, the object is restored with the authorization list of the existing object. If the saved object had an authorization list and the object does not exist and it is being restored to a different system than the save system, the object is restored and it is linked to the authorization list. If the authorization list does not exist, the public authority is set to *EXCLUDE.

If this value is not specified, authorization list differences are not allowed. If the saved object had an authorization list and the object exists on the system but does not have the same authorization list, the object is not restored. If the saved object had an authorization list and the object does not exist and it is being restored to a different system than the save system, the object is restored, but it is not linked to the authorization list, and the public authority is set to *EXCLUDE.

*FILELVL
File level id and member level id differences are allowed. An attempt will be made to restore existing physical files even though the physical file on the save media may have a different file level id or member level id than the physical file on the system. The physical file data will only be restored for those physical files whose format level identifiers on the save media match the format level identifiers of the corresponding physical file on the system.

If this value is not specified, file level id and member level id differences are not allowed. If an object already exists on the system with a different file level id or member level id than the saved object, the object is not restored.

*OWNER
Ownership differences are allowed. If an object already exists on the system with a different owner than the saved object, the object is restored with the owner of the object on the system.

If this value is not specified, ownership differences are not allowed. If an object already exists on the system with a different owner than the saved object, the object is not restored.

*PGP
Primary group differences are allowed. If an object already exists on the system with a different primary group than the saved object, the object is restored with the primary group of the object on the system.

If this value is not specified, primary group differences are not allowed. If an object already exists on the system with a different primary group than the saved object, the object is not restored.

Force object conversion (FRCOBJCVN)

Specifies whether to convert user objects to the format required for use in the current version of the operating system, or to be compatible with the current machine, when the objects are restored.

Notes:

  1. This parameter applies only to user objects of the *MODULE, *PGM, *SRVPGM, and *SQLPKG object types.
  2. An object must have creation data (either observable or unobservable) to be converted.
  3. If an object needs to be converted (because it is formatted for an earlier version of the operating system or is incompatible with the current machine), but is not converted during this restore operation, the object is automatically converted the first time it is used.

Single values

*SYSVAL
The objects are converted based on the value of the QFRCCVNRST system value.
*NO
The objects are not converted during the restore operation.

Note: If FRCOBJCVN(*NO) is specified, then the QFRCCVNRST system value must have a value of either "0" or "1".

Element 1: Convert during restore

*YES
The objects are converted during the restore operation.

Notes:

  1. If FRCOBJCVN(*YES *RQD) is specified, then the QFRCCVNRST system value must have a value of "0", "1", or "2". FRCOBJCVN(*YES *RQD) will override a QFRCCVNRST value of "0" or "1". If FRCOBJCVN(*YES *ALL) is specfied, then QFRCCVNRST can have any valid value and FRCOBJCVN(*YES *ALL) overrides the QFRCCVNRST system value.
  2. Specifying this value increases the time of the restore operation, but avoids the need to convert the objects when they are first used.

Element 2: Objects to convert

*RQD
The objects are converted only if they require conversion to be used by the current operating system or to be compatible with the current machine. If the objects do not have all creation data (either observable or unobservable), the objects cannot be converted and will not be restored.
*ALL
All objects are converted regardless of their current format and machine compatibility, including compatible objects already in the current format. However, if the objects do not have all creation data (either observable or unobservable), the objects cannot be converted and will not be restored.

Start journaling (STRJRN)

Specifies whether to start journaling for new objects that are restored.

Notes:

  1. Journal information that was saved will be restored for new objects whether journaling is started or not.
  2. Journaling will not be changed for existing objects.
*YES
Journaling will be started for new objects that were being journaled when they were saved.
*NO
Journaling will not be started for the objects that are restored.

Examples

Example 1: Saving and Restoring Multiple Changed Objects

SAVRSTCHG   OBJ(*ALL)  RMTLOCNAME(SYSTEM1)  LIB(*ALLUSR)
            OBJTYPE(*PGM)  STRLIB(MORE)  ALWOBJDIF(*NONE)

This command saves all changed objects whose type is *PGM and are located in user libraries beginning with the library named MORE. The objects are restored on the remote system named SYSTEM1.

Example 2: Saving and Restoring a Specific Changed Object

SAVRSTCHG   OBJ(PETE)  RMTLOCNAME(SYSTEM1)  LIB(RON)
            ALWOBJDIF(*ALL)  OPTION(*NEW)

This command saves changed objects named PETE of all types supported, which is located in the library named RON, and restores the object on the remote system named SYSTEM1 if the object does not already exist on the remote system.

Error messages

*ESCAPE Messages

CPCAD80
&1 objects saved and restored.
CPFAD8D
An error occurred during the &1 operation.
CPFAD80
Unable to establish connection from &1 to &2.
CPFAD81
User profile &1 not found on remote location &2.
CPFAD82
Remote location &1 not found.
CPFAD83
Remote location &1 cannot be source location.
CPFAD84
ObjectConnect internal error, function code &1, return code &2.
CPFAD86
Location name &1 unable to close &2.
CPFAD88
Unable to establish connection from &1 to &2.
CPFAD93
APPC failure. Failure code is &3.
CPF389C
ObjectConnect internal error, function code &1, return code &2.