Save Restore Library (SAVRSTLIB)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Save/Restore Library (SAVRSTLIB) command allows the user to save and restore a copy of one or more libraries to another system. The system must have a supported communication link with the restoring system.

Documents and folders contained in the QDOC library can be saved and restored by using the Save/Restore Document Library Object (SAVRSTDLO) command.

The SAVRSTLIB command saves and restores the entire library; this includes the library description, the object descriptions, and the contents of the objects in the library. For job queues, message queues, and logical files, only the object definitions are saved and restored, not the contents. Logical file access paths can be saved and restored by specifying ACCPTH(*YES). The contents of a save file can be saved and restored by specifying SAVFDTA(*YES). The contents of spooled files on output queues can be saved and restored by specifying SPLFDTA(*ALL). The contents of a data queue can be saved and restored by specifying QDTA(*DTAQ).

The libraries and their objects are not affected on the system unless the command specifies that the storage is to be freed.

The types of objects saved and restored by this command are the same as those listed in the OBJTYPE parameter description in "Commonly used parameters: Expanded descriptions" in the CL concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter, with the addition of *DTADCT. Certain I5/OS system objects that are not contained in user libraries (such as user profiles) are not saved and restored by this command. They can be saved by the Save System (SAVSYS) or Save Security Data (SAVSECDTA) commands, and restored by using the Restore User Profile (RSTUSRPRF) command.

Restrictions:

  1. To use this command, the user must have either the special authority *SAVSYS specified in the user profile by the SPCAUT parameter, or the user must have:
    • Read authority for, or be the owner of, each library specified.
    • Object existence authority for each object in the library.

    If the user does not have the correct authorities for all of the libraries and objects specified, only those for which the user does have authority are saved and restored.

  2. No library that is being saved and restored, or the objects in the library being saved and restored, can be updated by a job that is running at the time the save and restore operation occurs unless save-while-active (SAVACT) is used.
  3. When the contents of a save file are saved and restored by specifying 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 I5/OS option is to be used, both systems must be joined by the OptiConnect for I5/OS hardware and software.
Top

Parameters

Keyword Description Choices Notes
LIB Library Single values: *NONSYS, *ALLUSR, *IBM
Other values (up to 300 repetitions): Generic name, name
Required, Positional 1
RMTLOCNAME Remote location name Name Required, Positional 2
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, *NODGRP, *NODL, *ORTBL, *OUTQ, *OVL, *PAGDFN, *PAGSEG, *PDFMAP, *PDG, *PGM, *PNLGRP, *PRDAVL, *PSFCFG, *QMFORM, *QMQRY, *QRYDFN, *RCT, *SBSD, *SCHIDX, *SPADCT, *SQLPKG, *SQLUDT, *SRVPGM, *SSND, *SVRSTG, *S36, *TBL, *USRIDX, *USRQ, *USRSPC, *VLDL, *WSCST
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, *ALL Optional
QDTA Queue data *NONE, *DTAQ Optional
STG Storage *KEEP, *FREE Optional
OPTION Option *ALL, *NEW, *OLD, *FREE Optional
MBROPT Data base member option *MATCH, *ALL, *NEW, *OLD Optional
ALWOBJDIF Allow object differences Single values: *NONE, *ALL
Other values (up to 4 repetitions): *AUTL, *FILELVL, *OWNER, *PGP
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
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
Top

Library (LIB)

Specifies which libraries to save and restore.

Notes:

  1. If using *NONSYS, or *IBM keywords some libraries will not be saved and restored, because they are being used for this operation.
  2. If the user specifies *ALLUSR on this parameter, this command should be run when the specified libraries are not being used. If objects in a library are in use while the library is being saved and restored, the objects are not saved and restored. To ensure a complete save and restore of all libraries, run the SAVLIB command with the system in a restricted state. For example, if SAVRSTLIB LIB(*ALLUSR) is run when the subsystem QSNADS is active, the QAO* files are not saved and restored in library QUSRSYS. To save and restore the *QAO files, end the QSNADS subsystem before running SAVRSTLIB LIB(*ALLUSR). Some subsystems cannot be ended when using the SAVRSTLIB command. The libraries associated with these subsystems will not be saved and restored using the SAVRSTLIB command.
    QSOC
    if using the optical bus transport with the SAVRSTLIB command
    QCMN
    if using the communications transport with the SAVRSTLIB command
*NONSYS
All user-created libraries, the QGPL and QUSRSYS libraries, and licensed program libraries such as QRPG and QIDU are saved. All subsystems must be ended by the End Subsystem (ENDSBS) or End System (ENDSYS) command before this option is specified. When *NONSYS is specified, the libraries are saved in alphabetical order on the media.
*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   QUSRIJS     QUSRVxRxMx
QGPL        QSRVAGT     QUSRINFSKR
QGPL38      QSYS2       QUSRNOTES
QMGTC       QSYS2xxxxx  QUSROND
QMGTC2      QS36F       QUSRPOSGS
QMPGDATA    QUSER38     QUSRPOSSA
QMQMDATA    QUSRADSM    QUSRPYMSVR
QMQMPROC    QUSRBRM     QUSRRDARS
QPFRDATA    QUSRDIRCL   QUSRSYS
QRCL        QUSRDIRDB   QUSRVI

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.

*IBM
Saves all system (IBM) libraries except for the following Q libraries:

QDOC        QRCL        QSYS         QUSRSYS
QDSNX       QRECOVERY   QS36F        QUSRVxRxMx
QGPL        QRPLOBJ     QTEMP
QGPL38      QSPLxxxx    QUSER38
QPFRDATA    QSRV        QUSRINFSKR

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.

The following libraries with names that do not begin with the letter Q are also saved:

#CGULIB      #DFULIB      #RPGLIB      #SEULIB
#COBLIB      #DSULIB      #SDALIB

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

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

Starting library (STRLIB)

Specifies the library with which to begin the *NONSYS, *IBM, or *ALLUSR save operation.

Note: This parameter is valid only if *NONSYS, *IBM, or *ALLUSR is specified on the Library (LIB) parameter.

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

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

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 concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.

Top

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

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

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

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

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.

Note: This value cannot be specified if the Target release (TGTRLS) parameter value is earlier than V5R3M0.

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

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

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 Backup and Recovery 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.

Top

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

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.
*ALL
For each output queue that is saved, all available spooled file data on the output queue is saved.
Top

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

Storage (STG)

Specifies whether the system storage that is occupied by the data portion of the specified members (except for save files), modules, programs, service programs, Structured Query Language (SQL) packages, and journal receivers in the library being saved is freed as part of the save operation. Only the data portion of the objects is freed, not the descriptions of the objects.

*KEEP
The storage occupied by the data portion of the objects being saved is not freed.
*FREE
The storage occupied by the data portion of the specified objects being saved is freed as part of the save operation. The storage for all the objects in a library is freed only after all the objects in that library are saved successfully.

Note: To prevent the possible abnormal end of a program, the program being saved must not be running in the system when *FREE is specified.

Top

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

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

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

Top

Restore to library (RSTLIB)

Specifies whether the library contents are restored to the same library from which they were saved, or to a different library. If a different library is specified, you cannot specify *NONSYS, *ALLUSR, or *IBM for the Library (LIB) parameter.

*LIB
The library contents are restored to the same library or libraries from which they were saved.
name
Specify the name of the library where the saved library contents are being restored. If *NONSYS, *ALLUSR, or *IBM is specified on the LIB parameter, a library name cannot be specified on this parameter.

Note: If an SQL database is restored to a library other than the one in which it was saved, the journals are not restored.

Top

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

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 Backup and Recovery 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.
Top

Force object conversion (FRCOBJCVN)

Specifies whether to convert user objects to the format required for use in the current version of the operating system 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), 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. 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, including 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.
Top

Examples

Example 1: Saving and Restoring All User Libraries

SAVRSTLIB   LIB(*ALLUSR)  RMTLOCNAME(SYSTEM1)
            STRLIB(GFM1)  OPTION(*OLD)

This command saves all user libraries beginning with the GFM1 library and restores them on a remote system named SYSTEM1. Only the objects in the library having a saved version are restored.

Example 2: Saving and Restoring Specific Libraries

SAVRSTLIB   LIB(GRUNBOK TIMON VASEK)  RMTLOCNAME(SYSTEM1)

This command saves the following libraries GRUNBOK, TIMON and VASEK and restores them on a remote system named SYSTEM1.

Top

Error messages

*ESCAPE Messages

CPCAD81
&1 libraries saved and restored.
CPFAD8B
An error occurred during the SAVRSTLIB 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.
Top