TAA Tools
SAVRSTASP       SAVE AND RESTORE TO ASP                TAASAWE

The Save  and Restore  ASP command  allows a  library to  be saved  and
restored from  one ASP to  another.  Both  named and numbered  ASPs are
supported.   An option  exists to delete the  existing library and must
be used if the  same library name is used  for the restore library.   A
permanent library  must be used  for the creation  of a save  file used
to save  the library to and restore from.   The save file is deleted if
SAVRSTASP completes successfully.

Several requirements exist for the use of SAVRSTASP.

  **   *SAVSYS special authority is required.

  **   The library to  be saved  must not  be owned by  an IBM  profile
       such as QSYS or QLPAUTO.

  **   The library  to be  restored must  not exist  in the  ASP to  be
       restored to.

  **   If  the  same library  name  is used  for  the  restore library,
       DLTSAVLIB(*YES) must be specified.

  **   A library to  be used for  the TAASAVF save file  must be  named
       and must  exist in the  system ASP.   It cannot  be the same  as
       the  library to be  saved.  The  save file  is used to  save the
       library to and restore from.

  **   The  size of the library to be saved  must not exceed 80% of the
       available space in  the system ASP nor  80% of the space  in the
       ASP of the  library to be restored.  If both  ASPs are the same,
       the limit is 40%.

  **   If  an  ASP  device  name  is  used,  the  ASP  must  be  in  an
       *AVAILABLE status and must be the current ASP for the job.

Because of the  restrictions, you cannot use  SAVRSTASP to duplicate  a
library  of the  same name  to  a named  ASP.   This  is generally  not
desirable  anyway as  this would  cause  an error  if you  attempted to
mount the ASP (you cannot  have 2 libraries with  the same name in  the
name  space).   You  can 'move'  the  library to  the  same name  (this
deletes the  existing library).  To duplicate a  library to a named ASP
would  require  you to  restore to  a different  library name  and then
rename the library at a later point.

A typical  command to 'move'  a library  (using save/restore) from  one
ASP to another would be:

             SAVRSTASP    LIB(LIB1) RSTASP(2) DLTSAVLIB(*YES)

By default,  the LIB1 library would  be saved to the  TAASAVF save file
in  TAAWORK.  LIB1  would then be  deleted.  RSTLIB would  then be used
to restore LIB1 from the TAASAVF  save file to the LIB1 library in  ASP
2.  The TAASAVF  would be deleted if SAVRSTASP  completes normally.  If
LIB1  cannot be successfully deleted  or restored, it  may be necessary
to use RSTLIB to recover using the TAASAVF in TAAWORK.

Another example would  be to  duplicate a library  to a  named ASP  and
assign a different name.

             SAVRSTASP    LIB(LIB1) RSTLIB(LIB2)
                            RSTASPDEV(PRODUCTION)

As in  the previous example,  LIB1 would be  saved to the  TAASAVF file
in  TAAWORK and then  restored to LIB2  in the named  ASP (PRODUCTION).
LIB1 would be retained.

Recovery
--------

In  order  to move  a  library of  the same  name  to a  different ASP,
SAVRSTASP must prevent the same library name from existing twice.

To achieve this, the named  library is saved to a save file  TAASAVF in
a library (default is TAAWORK) and then deleted.

The library is then restored and the save file is deleted.

An  error can occur  in several  places and  recovery is  described for
each:

  **   When  saving  the  library.   The  library  still  exists.   The
       TAASAVF save  file in  TAAWORK  should be  deleted and  you  may
       start the process again after correcting the problem.

  **   When deleting  the library.  This  could occur if an  object was
       locked  after the save  occurred.  If  some of the  objects have
       been deleted,  delete  the remainder  of  the library  and  then
       restore from  the TAASAVF save  file.   Delete the TAASAVF  save
       file when the restore is complete.

  **   When restoring the library.

                 If  you  want  to go  back  to  the original  position
                 before  running SAVRSTLIB,  delete whatever  exists of
                 the restored  library, restore from  the TAASAVF  save
                 file  to  the  saved   library  and  then  delete  the
                 TAASAVF save file.

                 If  you  want  to  complete  the  restore  of the  new
                 library, complete the  restore from  the TAASAVF  save
                 file and then  delete the TAASAVF save file.   In some
                 cases,   it  may   be  necessary  to   use  additional
                 parameters  on  a  RSTLIB  command  to  complete   the
                 restore.

SAVRSTASP escape messages you can monitor for
---------------------------------------------

None.  Escape messages from based on functions will be re-sent.

Command parameters                                    *CMD
------------------

   SAVLIB        The  library to  be  saved.   Libraries  owned by  IBM
                 profiles may not be specified.

   SAVFLIB       The  library to  be used  for  the TAASAVF  save file.
                 The  default  is  TAAWORK.   The  save  file  must not
                 exist.  It  will be created  by SAVRSTASP and  deleted
                 if  SAVRSTASP completes  normally.   QTEMP may  not be
                 named as the library.

                 The  purpose of requiring a  permanent library for the
                 TAASAVF save  file is  to allow  for  recovery if  the
                 library  that  was  saved  could  not  be  deleted  or
                 restored.    It  may be  necessary  to  use RSTLIB  to
                 recover  using  the  TAASAVF  save  file.    See   the
                 previous section on Recovery.

   RSTLIB        The  library name  to  restore  to.   *SAVLIB  is  the
                 default meaning  to use the  same name as  the library
                 to be saved.

                 The  'restore to'  library must  not exist  unless the
                 same name  as  the  SAVLIB  library is  used  (or  the
                 default *SAVLIB) and DLTSAVLIB(*YES) is specified.

   RSTASPDEV     The ASP device to be used to restore to.

                 *SAVASPDEV  is   the  default  meaning   the  data  is
                 restored  to   the  same  ASP  device  as  the  SAVLIB
                 library.

                 A specific ASP  device may  be named, but  must be  in
                 an  *AVAILABLE   status  and   must  be   assigned  by
                 SETASPGRP.

                 A specific  ASP device may not be  named if the RSTASP
                 parameter specifies an ASP number.

   RSTASP        The ASP number to be used to restore to.

                 *SAVASP is the  default meaning the  data is  restored
                 to the same ASP as the SAVLIB library.

                 A  specific  number  in  the  range   of  1-32  of  an
                 existing ASP may be named.

                 A  specific  ASP  number  may  not  be  named  if  the
                 RSTASPDEV parameter specifies a device.

   DLTSAVLIB     A  *YES/*NO  option  for  whether  the  SAVLIB library
                 should  be  deleted before  restoring  from  the  save
                 file.

                 *NO is  the default which  is not valid if  the SAVLIB
                 and RSTLIB parameters describe the same library.

                 *YES  may be specified to delete  the library after it
                 is saved to the save file.

Restrictions
------------

See previous comments.

Prerequisites
-------------

The following TAA Tools must be on your system:

     CHKOBJ3         Check object 3
     CHKSAVSYS       Check *SAVSYS special authority
     EDTVAR          Edit variable
     RSNLSTMSG       Resend last message
     RTVASPSTS       Retrieve ASP status
     RTVLIBSIZ       Retrieve library size
     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message
     SNDSTSMSG       Send status message

Implementation
--------------

None, the tool is ready to use.

Objects used by the tool
------------------------

   Object        Type    Attribute      Src member    Src file
   ------        ----    ---------      ----------    ----------

   SAVRSTASP     *CMD                   TAASAWE       QATTCMD
   TAASAWEC      *PGM       CLP         TAASAWEC      QATTCL
					

Added to TAA Productivity tools January 1, 2007


Home Page Up to Top