Restoring objects

You can use the Restore Object (RSTOBJ) command to restore individual objects or an entire library. When you restore a library by using the RSTOBJ command, the library description is not restored.

The following conditions apply when using the RSTOBJ command:

  • The RSTOBJ command restores objects to only one library.
  • Multiple concurrent RSTOBJ commands might be run against a single library.
  • Up to 300 objects or generic object values can be omitted on the OMITOBJ parameter.
  • Multiple concurrent RSTOBJ commands can run against a single library concurrently with the following commands:
    • The Save Library (SAVLIB) command
    • The Restore Library (RSTLIB) command
    • One or more Save Object (SAVOBJ) commands
    • The RSTLIB command and the SAVOBJ command
    • The SAVLIB command and the SAVOBJ command
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)
Start of changeWhen 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) 
End of change