TAA Tools
DTAARC          DATA ARCHIVE                           TAADBLD

The  Data  Archive  provides  online  save  files  for  critical  data.
Multiple  version may  exist.   Options exist  for 'save  while active'
and  saving dependent logical  files.  The DTAARC  tool is not intended
to replace normal backup.  A  typical use would be to restore  the save
file  to  a different  library  to  review a  previous  value.   In  an
emergency, you can restore from the online save files.

The  DTAARC  tool  is  designed for  reasonably  small  files.    It is
assumed that you will  also be backing up  normally to off line  media.
You may  decide to not save  the library containing the  DTAARC control
files and online save files.

Several commands exist:

      - CRTDTAARC     Create Data Archive
      - DLTDTAARC     Delete Data Archive
      - WRKDTAARC     Work Data Archive
      - STRDTAARC     Start Data Archive
      - ADDDTAARC     Add Data Archive
      - DSPDTAARC     Display Data Archive
      - RTVDTAARC     Retrieve Data Archive

Test driving the DTAARC tool
----------------------------

A  library will be  used to contain  both the DTAARC  control files and
the save files.  A unique library is preferred.

  **   Create the Data Archive control files with the command:

             CRTDTAARC    DTAARCLIB(xxx)

  **   Enter the command that will allow  you to define the files  that
       will be used.

             WRKDTAARC    DTAARCLIB(xxx)

       For a test  use, use one or more  small test files that  are not
       active.

       When the prompt  appears, use F6 to enter  the file name and the
       library  of the file.  A unique  2 character ID must be assigned
       to each  file.   This allows a  naming convention  for the  save
       files (see the section on 'Save file naming convention'.

       For  a simple  test, just  take the  defaults for  the remaining
       parameters.   To  understand the  parameters, see the  help text
       or the  parameter  descriptions  for the  ADDDTAARC  command  in
       this documentation.

  **   Start the archive save process with STRDTAARC.

             STRDTAARC    DTAARCLIB(xxx)

       The  command  determines the  files  you  have requested  to  be
       archived.   See  the discussion  on  'saving logical  files' for
       whether dependent logical  files are  also saved.   By  default,
       the files  defined on  WRKDTAARC assume  the files  will not  be
       active when the save occurs.

       All  saves specify  UPDHST(*NO)  meaning the  the  objects being
       saved are not marked as saved to the save files.

       The  save occurs to a save file which  is created as part of the
       STRDTAARC function.

  **   Work with the files that were identified:

             WRKDTAARC    DTAARCLIB(xxx)

       The last  save  date  for each  file  is  identified.   You  may
       display or  change the  information about the  options specified
       when the file was described to DTAARC.

       Use  Option 5  to display  the detail  information for  the last
       saved file used.

       Use option 8 to display the saved file versions.

       Use option  5 from the  display of  the saved  file versions  to
       invoke DSPSAVF.

       Use  option 9  from  the display  of  the  saved file  versions.
       This prompts  for the RSTOBJ command.   The basic parameters are
       protected.  The  'Restore to  library prompt'  appears in  error
       because blanks  are provided.   Enter  a different library  name
       or use *SAVLIB  to restore over the existing  file.  Press F9 to
       see all of the RSTOBJ prompts.

  **   Display the files being archived:

             DSPDTAARC    DTAARCLIB(xxx)

  **   You  may  want  to change  the  maximum number  of  versions (by
       using  WRKDTAARC) and  then  try  the STRDTAARC  command  again.
       When the  maximum number of  versions is exceeded  (after saving
       to  the current  save file),  the STRDTAARC command  deletes the
       excess versions.

  **   If you have completed the  test, you can delete the file  record
       and any associated versions by entering:

             WRKDTAARC    DTAARCLIB(xxx)

       and  then  using  Option  4.   Both  the  file  record  and  any
       associated save file versions will be deleted.

  **   If  you  no  longer  need  the  DTAARC  control files  and  have
       *ALLOBJ special authority, enter:

             DLTDTAARC    DTAARCLIB(xxx)

Deleting old versions
---------------------

The STRDTAARC command will cleanup  excess save file versions based  on
the 'maximum  versions to keep'  parameter entered when  a new file  is
described using WRKDTAARC.  You may change this value at any time.

You may  also want to  delete a save  file version manually.   This can
be  done from WRKDTAARC  by using Option 8  (Display versions) and then
Option 4 from the list of versions for a file.

If you no longer  want a file to be  saved by STRDTAARC, Option 4  from
the WRKDTAARC  display will  delete the file  record and any  save file
versions for the file.

Save file naming convention
---------------------------

Each  file  to  be  saved by  the  DTAARC  tool,  requires  a unique  2
character ID be assigned.  The save file name is made up of:

        2  Unique ID
        7  CYYMMDD
        1  A letter A-Z

The first or  only save file  created for a  file on  a given day  will
have a  last letter  of 'A'.   There is  a maximum  of 26  versions for
each file to be saved on a given day.

Security considerations
-----------------------

  **   CRTDTAARC.   The  command defaults  to allow  *USE of  the files
       that are created.  Only a  user with *CHANGE authority can  add,
       change, or delete the data in the DTAARCP file.

  **   WRKDTAARC.   The user must  have *USE  authority to the  DTAARCP
       file to use the display options.

       Option  8=Display  versions  requires authorization  to  display
       the save files.

       To  add, change, or  delete a record  requires *CHANGE authority
       to the DTAARCP file.

  **   STRDTAARC.   The user  must have *SAVSYS  special authority  and
       *CHANGE authority to the DTAARCP file.

  **   ADDDTAARC.    The  user  must  have  *CHANGE  authority  to  the
       DTAARCP file.

  **   DSPDTAARC.   The  user must have  *USE authority  to the DTAARCP
       file.

  **   RTVDTAARC.  The  user must  have *USE authority  to the  DTAARCP
       file.

DLTDTAARC escape messages you can monitor for
----------------------------------------------

      TAA9891    Not all save files could be deleted.

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

STRDTAARC escape messages you can monitor for
----------------------------------------------

      TAA9892    The specifically named file is not in DTAARCP

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

RTVDTAARC escape messages you can monitor for
----------------------------------------------

      TAA9892    The specifically named file is not in DTAARCP

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

ADDDTAARC escape messages you can monitor for
----------------------------------------------

      TAA9893    The ID already exists
      TAA9894    The file record already exists

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

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

   DTAARCLIB     The  library to  contain the  Data  Archive files  and
                 save  files.    A  physical  file  (DTAARCP)  and  two
                 logical files (DTAARCL and  DTAARCM) will be  created.

   SRCLIB        The  source  library  to  use  for  the  QATTDDS  file
                 source.  The default is *TAAARC.

                 A specific  user library may be named,  but the source
                 file name must be QATTDDS.

   AUT           The authority to the DTAARCP physical file.

                 *USE is the default.

                 *CHANGE or *EXCLUDE may be specified.

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

   DTAARCLIB     The  library that contains the  Data Archive files and
                 save files.    The  physical file  (DTAARCP)  and  two
                 logical  files (DTAARCL and  DTAARCM) will  be deleted
                 along with any save files created.

                 The  default is *LIBL.  A  specific library or *CURLIB
                 may also be entered.

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

   DTAARCLIB     The library that contains  the Data Archive files  and
                 save files.

                 The default is  *LIBL.  A specific  library or *CURLIB
                 may also be entered.

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

   FILE          The qualified name of the file to be saved.

                 The  default   is  *ALL/*ALL  for  all  files  in  the
                 DTAARCP  file   that  specify   *YES  for   'Save   by
                 STRDTAARC *ALL'.

                 A specific file may  be named to be saved.   A library
                 name is  required.  Both the file  and library portion
                 default  to  *ALL.   You may  save  *ALL files  from a
                 specific library or  a specific file name  that exists
                 in multiple libraries.

   SPLFILE       A *YES/*NO  parameter for whether a  spooled file will
                 be output with a summary of the results.

                 *YES  is the default to create  the spooled file.  One
                 line is output for each file.

                 *NO may be  specified to bypass the  output.  *NO  may
                 be desirable if a specific file is being saved.

   DTAARCLIB     The library that  contains the Data Archive  files and
                 save files.

                 The default  is *LIBL.  A  specific library or *CURLIB
                 may also be entered.

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

   FILE          The  qualified  name  of  the  physical  file  to   be
                 entered into the DTAARCP file.

                 The library name defaults to *LIBL.

   ID            The unique 2 character ID assigned to the file.

   SAVACT        A  *YES/*NO  parameter  for  whether   a  'save  while
                 active' should be used.

                 *NO  is  the  default  meaning  the  file may  not  be
                 opened for update when the save begins.

                 *YES  may be specified to  cause the system to perform
                 a    'save     while     active'    function     using
                 SAVACT(*SYSDFN).   This  means that  other objects  in
                 the  library may be changing while  you are saving the
                 specified object.   The specified file  may not be  in
                 a consistent  state in relationship to  other objects.

                 Since  one of the  purposes of  the DTAARC tool  is to
                 allow a review of the data  'as it was' as opposed  to
                 using  it for  a restore,  using  'save while  active'
                 may be  desirable.  You do not  have to consider which
                 files are open for update when STRDTAARC is used.

                 Using  the  'save  while  active'  function  means you
                 will rely  on your normal  backup for recovery  unless
                 an emergency exists.

   SAVDEPLF      A  *YES/*NO parameter  for  whether dependent  logical
                 files should be saved.

                 *NO  is the default meaning only  the physical file is
                 saved.

                 *YES may be specified  to cause any dependent  logical
                 files  (in the  same library  as the  physical) to  be
                 saved.    If  a  dependent  file  is  in  a  different
                 library, the save  of the dependent  file is  ignored.
                 This is  a restriction  of SAVOBJ  which requires  all
                 objects to be saved from the same library.

   SAVBYALL      A  *YES/*NO parameter for  whether the file  should be
                 saved if STRDTAARC FILE(*ALL/*ALL) is specified.

                 *YES  is the  default meaning  the file  will be saved
                 if FILE(*ALL/*ALL) is specified on STRDTAARC.

                 *NO may  be specified so  that the  file will only  be
                 saved  if  the  FILE  parameter on  STRDTAARC  is  not
                 *ALL/*ALL  and the  entry  specified matches  the file
                 name.

   MAXVER        The number of  versions to  be kept.   The default  is
                 1.  A number may be entered between 1 and 60.

   DTAARCLIB     The library that  contains the Data Archive  files and
                 save files.

                 The default  is *LIBL.  A  specific library or *CURLIB
                 may also be entered.

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

   DTAARCLIB     The library that contains  the Data Archive files  and
                 save files.

                 The default is  *LIBL.  A specific library  or *CURLIB
                 may also be entered.

   OUTPUT        How  to  output the  results.   *  is  the default  to
                 display  the spooled  file if  the command  is entered
                 interactively.  The  spooled file is deleted  after it
                 is displayed.

                 If  the  command is  entered  in  batch  or *PRINT  is
                 specified,  the spooled  file is output  and retained.

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

   FILE          The physical  file and  library  name where  the  file
                 exists that is being archived.

   RTNARCLIB     The library where  the data archive exists.   This may
                 be  helpful if  *LIBL is  specified for  the DTAARCLIB
                 parameter.   This is  an  optional parameter  that  if
                 used must be specified as *CHAR LEN(10).

   ID            The 2 character ID  assigned to the file.   This is an
                 optional parameter  that if used must  be specified as
                 *CHAR LEN(2).

   SAVACT        A  *YES/*NO  return value  for if  the  file is  to be
                 saved while  active.   This is  an optional  parameter
                 that if used must be specified as *CHAR LEN(4).

   SAVDEPLF      A  *YES/*NO  return  value  for if  dependent  logical
                 files  are  to  be saved  when  the  physical  file is
                 saved.  This  is an  optional parameter  that if  used
                 must be specified as *CHAR LEN(4).

   SAVBYALL      A  *YES/*NO return  value for  if the  file should  be
                 saved  if   STRDTAARC  FILE(*ALL/*ALL)  is  specified.
                 This is an  optional parameter  that if  used must  be
                 specified as *CHAR LEN(4).

   MAXVER        The maximum  number of  versions to  be kept on  line.
                 This  is an optional  parameter that  if used  must be
                 specified as *DEC LEN(3 0).

   CURVER        The  current number  of versions  kept on  line.  This
                 is  an  optional  parameter  that  if   used  must  be
                 specified as *DEC LEN(3 0).

   LSTSAVDAT     The  last save date  when STRDTAARC  was used  to save
                 the  file.    The  format  is  CYYMMDD.    This is  an
                 optional parameter that if  used must be specified  as
                 *CHAR LEN(7).

   LSTSAVVER     The  last save  file name  associated  with the  file.
                 This  is an  optional parameter that  if used  must be
                 specified as *CHAR LEN(10).

   DTAARCLIB     The library that contains  the Data Archive files  and
                 save files.

                 The default is  *LIBL.  A specific library  or *CURLIB
                 may also be entered.

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

If you  have requested a  save of dependent  LFs and a  dependent LF is
in  a  different  library  than  the physical  file,  the  save  of the
dependent file is ignored.

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

The following TAA Tools must be on your system:

     CHGOBJD2        Change object description 2
     CHKACTOBJ       Check active object
     CHKALLOBJ       Check *ALLOBJ special authority
     CHKNAM          Check name
     CHKOBJ3         Check object 3
     CHKSAVSYS       Check *SAVSYS special authority
     CPYTAADDS       Copy TAA DDS
     DSPDBFA         Display data base file attributes
     EDTVAR          Edit variable
     RSNLSTMSG       Resend last message
     RTVDAT          Retrieve date
     RTVDBFA         Retrieve data base file attributes
     RTVDBR          Retrieve data base file relations
     RTVOBJLST       Retrieve object list
     RTVSYSVAL3      Retrieve system value 3
     SNDCOMPMSG      Send completion message
     SNDDIAGMSG      Send diagnostic message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message
     SNDSTSMSG       Send status message
     UPDPFILE        Update PFILE keyword

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

None, the tool is ready to use.

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

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

   CRTDTAARC     *CMD                   TAADBLD       QATTCMD
   DLTDTAARC     *CMD                   TAADBLD2      QATTCMD
   WRKDTAARC     *CMD                   TAADBLD3      QATTCMD
   STRDTAARC     *CMD                   TAADBLD4      QATTCMD
   ADDDTAARC     *CMD                   TAADBLD5      QATTCMD
   DSPDTAARC     *CMD                   TAADBLD6      QATTCMD
   RTVDTAARC     *CMD                   TAADBLD7      QATTCMD
   TAADBLDC      *PGM       CLP         TAADBLDC      QATTCL
   TAADBLDC2     *PGM       CLP         TAADBLDC2     QATTCL
   TAADBLDC3     *PGM       CLP         TAADBLDC3     QATTCL
   TAADBLDC4     *PGM       CLP         TAADBLDC4     QATTCL
   TAADBLDC5     *PGM       CLP         TAADBLDC5     QATTCL
   TAADBLDC6     *PGM       CLP         TAADBLDC6     QATTCL
   TAADBLDC7     *PGM       CLP         TAADBLDC7     QATTCL
   TAADBLDC23    *PGM       CLP         TAADBLDC23    QATTCL
   TAADBLDC24    *PGM       CLP         TAADBLDC24    QATTCL
   TAADBLDC25    *PGM       CLP         TAADBLDC25    QATTCL
   TAADBLDC26    *PGM       CLP         TAADBLDC26    QATTCL
   TAADBLDC27    *PGM       CLP         TAADBLDC27    QATTCL
   TAADBLDR3     *PGM       RPG         TAADBLDR3     QATTRPG
   TAADBLDR4     *PGM       RPG         TAADBLDR4     QATTRPG
   TAADBLDR5     *PGM       RPG         TAADBLDR5     QATTRPG
   TAADBLDR6     *PGM       RPG         TAADBLDR6     QATTRPG
   TAADBLDR24    *PGM       RPG         TAADBLDR24    QATTRPG
   TAADBLDP      *FILE      PF          TAADBLDP      QATTDDS
   TAADBLDL      *FILE      PF          TAADBLDL      QATTDDS
   TAADBLDM      *FILE      PF          TAADBLDM      QATTDDS

Structure
---------

CRTDTAARC   Cmd
   TAADBLDC   CL pgm

DLTDTAARC   Cmd
   TAADBLDC2  CL pgm

WRKDTAARC   Cmd
   TAADBLDC3  CL pgm
      TAADBLDR3   RPG pgm
        TAADBLDD    Display file
        TAADBLDC23  CL pgm for CHKOBJ and RTVDBFA
        TAADBLDC24  CL pgm using RTVOBJLST
        TAADBLDC26  CL pgm to delete save files
        TAADBLDR24   RPG pgm to display versions
          TAADBLDE    Display file
          TAADBLDC27   CL pgm to restore

STRDTAARC   Cmd
   TAADBLDC4  CL pgm
      TAADBLDC24  CL pgm using RTVOBJLST
      TAADBLDC25  CL pgm does CHGOBJD2 using adopt
      TAADBLDR4  RPG pgm to update save information

ADDDTAARC   Cmd
   TAADBLDC5  CL pgm
     TAADBLDR5  RPG pgm to add to file

DSPDTAARC   Cmd
   TAADBLDC6  CL pgm
     TAADBLDR6  RPG pgm to print

RTVDTAARC   Cmd
   TAADBLDC7  CL pgm
     TAADBLDR7  RPG pgm
					

Added to TAA Productivity tools April 15, 2006


Home Page Up to Top