TAA Tools
DUPFILFMT      DUPLICATE A FILE FORMAT WITHOUT A KEY       TAADBFK

The Duplicate  File Format  command duplicates  a file  using the  same
format  as a  specified file.   The  new file  will  not have  any keys
(i.e.   it is arrival sequence).  A  physical or logical (with a single
format) including a join file may be duplicated.

When using CRTDUPOBJ or  CPYF with CRTFILE(*YES), the new  file created
is an exact  duplicate of the original file.  If  the original file has
keys,  the duplicate will also  have keys.   CPYFRMQRYF may also create
a file from an ODP, but all column headings, text, etc are dropped.

In some  applications,  it  is desirable  to  have  a file  that  is  a
duplicate, but  uses arrival sequence.   This can be an  advantage when
sorting the original file or when creating a backup file.

To create a duplicate in a backup library you would specify:

        DUPFILFMT     FILE(FILEX) LIB(BACKUP)

A  member is created with  the same name  as the new file.   The number
or records in  the original  file is used  to help  determine the  SIZE
parameter of  the new file.   If the  size of the  file is  larger than
the system default  (10,000 records) then 10% is  added to the size and
10%  is used as the  increment.  The number of  increments is always 3.
Other attributes from  the file are ignored.   If the original  file is
being journaled, journaling will be dropped in the new file.

EDTCDE and EDTWRD attributes are included.

Individual  field  attributes  caused  by  such  keywords  as  DFT  and
ALWNULL are not included in the new file.

DUPFILFMT escape messages you can monitor for
---------------------------------------------

      TAA9891    Non data base file
      TAA9892    More than 998 fields
      TAA9893    Multi format file

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

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

   FILE          The   qualified   file  name   of  the   file   to  be
                 duplicated.  The  library name defaults  to *LIBL.   A
                 physical or  logical (with a single  format) including
                 a join file may be duplicated.

   TOLIB         The library to duplicate the file into.

   NEWFILE       The  new file name for  the duplicate.   The file must
                 not exist.  The  default is *FILE  meaning to use  the
                 same name as the original file.

   MBR           The member  name to  be added  to the new  file.   The
                 default is *FILE or the same name as the file.

   TEXT          The text  description for the  new file.   The default
                 is  *DFT  which  will produce  a  description  such as
                 'File created by DUPFILFMT by XXXX in YYYY'.

                 *FILE may  be  entered to  use the  same  text as  the
                 original file.

                 A string of text may also be entered.

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

  **   Certain field types such as BLOB and CLOB cannot be created.

  **   A file may have a maximum of 998 fields.

  **   Only single format logical files are valid.

  **   Individual field  attributes caused by such keywords  as DFT and
       ALWNULL are not included in the new file.

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

The following TAA Tools must be on your system:

      HLRMVMSG     HLL Remove message
      RTVDBFA      Retrieve data base file attributes
      RTVSYSVAL3   Retrieve system value 3
      SNDCOMPMSG   Send completion message
      SNDESCMSG    Send escape message

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

None, the tool is ready to use.

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

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

   DUPFILFMT     *CMD                      TAADBFK        QATTCMD
   TAADBFKC      *PGM          CLP         TAADBFKC       QATTCL
   TAADBFKR      *PGM          RPG         TAADBFKR       QATTRPG
					

Added to TAA Productivity tools April 1, 1995


Home Page Up to Top