Restoring objects

Start of changeYou can use the Restore Object (RSTOBJ) command to restore one or more objects to a library.End of change

Start of changeYou can use the RSTOBJ command to restore objects that were saved by the Save Library (SAVLIB), Save Object (SAVOBJ), or Save Changed Objects (SAVCHGOBJ) commands. You must restore objects to an existing library. When you restore all objects from data that was saved by the SAVLIB command, the library description is not restored.End of change

Start of changeThere are several parameters on the RSTOBJ command that allow you to specify which objects to restore. Parameters that allow you to select objects from the save media include Objects (OBJ), Saved Library (SAVLIB), Object types (OBJTYPE), Libraries to omit (OMITLIB), Objects to omit (OMITOBJ), Select (SELECT), and File member (FILEMBR). The Restore to library (RSTLIB), Restore to ASP device (RSTASPDEV), and Restore to ASP number (RSTASP) parameters allow you to specify where to restore the objects. The Option (OPTION), Data base member option (MBROPT), and Allow object differences (ALWOBJDIF) parameters allow you to specify whether to restore objects that already exist in the destination library.End of change

Start of changeYou can run multiple concurrent RSTOBJ commands for one or more libraries, if the saved objects are available on different save media.End of change

Attention: Do not use RSTOBJ to restore licensed programs to library QSYS. Unpredictable results can occur.
Example: This example restores the most recently saved version of data area CLUSTERDTA in library LIBX, using tape device TAP01.
RSTOBJ  OBJ(CLUSTERDTA)  SAVLIB(LIBX)  DEV(TAP01)
        OBJTYPE(*DTAARA) VOL(*SAVVOL)
When you restore individual objects from a tape file that contains many saved objects, you can improve the performance of the restore operation if you specify the following information:
  1. Tape file sequence number.

    The tape file sequence number is the quickest way to locate the tape file that contains the wanted objects.

  2. Specific object name and type.

    The specific object name and specific object type, when specified, causes the restore operation to stop searching when the wanted object is found. If *ALL, a generic name or more than one object type is specified, the restore operation searches through the entire tape file, trying to find additional matching objects.

  3. Starting position.

    The starting position in the tape file for each object is provided by save operations when output to an outfile is requested.

Example: This example restores the object Z0002OFR in library TESTLIB, using device TAP02 and specifying the saved object located at tape file sequence number 3199 and at the starting position '00000000000027FC0000000000004964'.
RSTOBJ  OBJ(Z0002OFR)  SAVLIB(TESTLIB)  DEV(TAP02)
        SEQNBR(3199) POSITION(00000000000027FC0000000000004964)