TAA Tools
CRTDUPOBJ2      CREATE DUPLICATE OBJECT 2              TAAOBKG

The  Create  Duplicate  Object 2  command  is  similar  to  the  system
CRTDUPOBJ  command,  but  will  automatically  delete the  same  object
name/type  in the  To library if  it exists.   The same  ownership or a
new owner  may  be assigned.   This  allows  a refresh  to  occur of  a
subset or duplicate library.  Not all object types are supported.

A typical command would be:

             CRTDUPOBJ2    OBJ(*ALL) FROMLIB(xxx) TOLIB(yyy)
                             SPLF(*YES) DATA(*YES)

All objects that  exist in the From Library would  be duplicated to the
To  library.    If the  object/object  type already  exists  in  the To
library, it is deleted first.   A spooled file would be created of  the
results.   If any  physical files  were duplicated,  the data would  be
copied to the new file.

The new owner would be the user of CRTDUPOBJ2.

If  an object type  cannot be duplicated  by the CRTDUPOBJ  command, an
error will occur.   The TAA command CRTDUPDTAQ  is used to duplicate  a
data queue.

You may optionally decide to duplicate:

        Named objects
        Generic objects
        A list of object types

You may optionally  exclude a list  of objects and/or  generic objects.

You may optionally receive an escape message if errors occur.

Authorization required
----------------------

The  CRTDUPOBJ2 command runs  the system CRTDUPOBJ  command internally.
To run CRTDUPOBJ, you must have the following authority:

        *OBJOPR
        *OBJMGT
        *READ
        *EXECUTE

If  the  same object/object  type exists  in the  To library,  you must
have authority to delete the object.

If  the  NEWOWN  parameter   is  other  than  *CURRENT,  the   user  of
CRTDUPOBJ2 must have *ALLOBJ special authority.

Attribute checking
------------------

CRTDUPOBJ2 requires  that the  attribute of an  existing object  be the
same.     For  example,  you  cannot   replace  a  display  file  (DSPF
attribute) with a physical file (PF attribute).

If you  want to  make such  a replacement,  you must  first delete  the
object in the To library.

CRTDUPOBJ2 escape messages you can monitor for
----------------------------------------------

      TAA9896    Some errors occurred (based on ESCAPE parameter)

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

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

   OBJ           The  object name  to be  duplicated.   A generic  name
                 may be used or the special value *ALL.

   FROMLIB       The  From  Library  where  the  objects  exist  to  be
                 duplicated from.  *CURLIB may be specified.

                 The QSYS library is prohibited.

   TOLIB         The  To   Library   where  the   objects   should   be
                 duplicated  to.   If  the object/object  type  already
                 exists, it is deleted first.

                 The QSYS library is prohibited.

   OBJTYPE       A  list of  up to  40 object  types to  be duplicated.
                 See  the  command  prompt  for a  list  of  the object
                 types.

                 Some object types appear  in the command prompt  list,
                 but will not  be valid such as *JRN  and *JRNRCV.  The
                 object  list on  the command  prompt is intended  as a
                 reminder of the possible types.

                 If an object is to  be deleted first, the deletion  is
                 performed by  the TAA  Tool DLTOBJ2  which is  limited
                 to typical object types.

                 All  those object types supported  by CRTDUPOBJ can be
                 duplicated along with *DTAQ object types.

   EXCLUDEOBJ    A list of  up to  300 object or  generic object  names
                 that  should  be  excluded.    The  default  is  *NONE
                 meaning  all  objects  are  considered  based  on  the
                 other parameters.

                 You  may specify  a generic  object name  such as XXX*
                 and  exclude  specific  objects  within  that  generic
                 name.

                 There  is no  check for  illogical statements  such as
                 OBJ(XXX*) and EXCLUDEOBJ(XXX*).

   ASPDEV        Specifies  the  auxiliary  storage  pool (ASP)  device
                 name where  storage  for the  library  containing  the
                 object  to  be  duplicated (the  From  library  prompt
                 (FROMLIB  parameter)) is  allocated.   If  the library
                 is in  an  ASP  that  is  not  part  of  the  thread's
                 library space,  this  parameter must  be specified  to
                 ensure  the correct  object  is duplicated.    If this
                 parameter  is used when *LIBL  or *CURLIB is specified
                 for the  From library  prompt  (FROMLIB parameter),  *
                 is the only valid value.

                 * = The  ASPs that are currently part  of the thread's
                 library  name  space will  be searched  to  locate the
                 library.  This  includes the system  ASP (ASP 1),  all
                 defined  basic user  ASPs  (ASPs  2-32), and,  if  the
                 thread  has an  ASP group,  the primary  and secondary
                 ASPs in the thread's ASP group.

                 *CURASPGRP =  If  the thread  has  an ASP  group,  the
                 primary and secondary  ASPs in the thread's  ASP group
                 will be  searched to locate  the library.   The system
                 ASP  (ASP 1) and  defined basic user  ASPs (ASPs 2-32)
                 will not be searched.   If no ASP group  is associated
                 with the thread, an error will be issued.

                 *SYSBAS  = The  system  ASP (ASP  1)  and all  defined
                 basic  user  ASPs  (ASPs  2-32)  will  be searched  to
                 locate the  library.   No  primary or  secondary  ASPs
                 will  be  searched  even  if the  thread  has  an  ASP
                 group.

                 ASP  Device name = The  device name of  the primary or
                 secondary  ASP  to  be  searched.    The  primary   or
                 secondary ASP  must  have been  activated (by  varying
                 on the  ASP device) and have a  status of 'Available'.
                 The  system ASP  (ASP 1)  and defined  user basic ASPs
                 (ASPs 2-32) will not be searched.

   TOASPDEV      Specifies  the auxiliary  storage  pool  (ASP)  device
                 name  where storage  for  the library  to contain  the
                 new  object (the To  library prompt (TOLIB parameter))
                 is allocated.   If the library  is in an  ASP that  is
                 not  part   of  the   thread's  library   space,  this
                 parameter  must  be specified  to  ensure  the correct
                 object is  duplicated.    If this  parameter  is  used
                 when *CURLIB  is specified for  the To  library prompt
                 (TOLIB  parameter),  either   *  or  *ASPDEV  must  be
                 specified  and  the  From  ASP  device  prompt (ASPDEV
                 parameter) must be *.

                 *ASPDEV = The  ASP device specified  for the From  ASP
                 device prompt  (ASPDEV parameter) will  be searched to
                 locate the object.

                 *  = The ASPs that are  currently part of the thread's
                 library name  space will  be  searched to  locate  the
                 library.   This includes the  system ASP (ASP  1), all
                 defined  basic  user ASPs  (ASPs  2-32),  and, if  the
                 thread has  an ASP  group, the  primary and  secondary
                 ASPs in the thread's ASP group.

                 *CURASPGRP  = If  the  thread has  an  ASP group,  the
                 primary and  secondary ASPs in the  thread's ASP group
                 will  be searched to  locate the library.   The system
                 ASP (ASP 1)  and defined basic  user ASPs (ASPs  2-32)
                 will not be  searched.  If no ASP  group is associated
                 with the thread, an error will be issued.

                 *SYSBAS  =  The system  ASP  (ASP 1)  and  all defined
                 basic user  ASPs  (ASPs  2-32)  will  be  searched  to
                 locate  the library.    No primary  or secondary  ASPs
                 will  be  searched  even  if  the  thread has  an  ASP
                 group.

                 ASP Device name =  The device name  of the primary  or
                 secondary  ASP  to  be  searched.     The  primary  or
                 secondary  ASP must  have been  activated  (by varying
                 on  the ASP device) and  have a status of 'Available'.
                 The system  ASP (ASP  1) and defined  user basic  ASPs
                 (ASPs 2-32) will not be searched.

   NEWOWN        Who the owner  of the new object should  be.  *CURRENT
                 is   the  default  meaning  the   user  of  CRTDUPOBJ2
                 command  will  become  the  owner  of  the  duplicated
                 objects.

                 *SAME or a  specific user profile may  also be entered
                 if   the  user  of  CRTDUPOBJ2   has  *ALLOBJ  special
                 authority.  *SAME means that  the owner of the  object
                 in  the  From  Library  will  be   the  owner  of  any
                 duplicated  objects.   If a  specific user  profile is
                 entered,  the user  profile becomes  the owner  of any
                 the duplicated objects.

   AUT           What the authority to  the new object should be.   The
                 default  is *FROMOBJ  meaning any  authorities of  the
                 object  to  be  duplicated  (the  'from  object')  are
                 placed on the new object.

                 *TOOBJ may be specified  meaning that any  authorities
                 of an  object being  replaced (in  the TOLIB  library)
                 are  saved and placed on  the new object.   *TOOBJ may
                 only be specified when NEWOWN(*SAME) is used.

                 If *TOOBJ is specified and  the object does not  exist
                 in the  TOLIB library,  the authorities  of the  'from
                 object' are used.

   DATA          A  *YES/*NO parameter that  determines if data  in the
                 From  Library physical files will  be duplicated.  *NO
                 is the default.

                 *YES  causes the  data  to  be copied  from  the  From
                 library  object  to  the  To  library object.    If  a
                 multi-member   data  base  file   is  duplicated,  all
                 members are created and all member data is copied.

   SPLF          A  *YES/*NO  parameter   that  determines  whether   a
                 spooled file will  be produced with the  results.  *NO
                 is  the  default meaning  that  messages  are produced
                 for each object and a final message.

                 *YES  may  be  specified  to  cause  only  the   final
                 message to  be produced along  with a spooled  file of
                 the results.

   ESCAPE        A  *YES/*NO  parameter  for  whether TAA9896  will  be
                 sent  as an  escape message if  errors exist.   *NO is
                 the  default meaning  only  a  completion  message  is
                 sent.

                 *YES may be specified to cause the escape message.

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

You must  have the required authority  to the objects  to be duplicated
as  well  as  authority  to  delete  any  existing  objects  in the  To
library.

The TAA  Tool DLTOBJ2 is  used to  delete the  objects.   It will  only
delete typical object types.

The  system command  CRTDUPOBJ  will not  duplicate  all object  types.
Support  is limited to  those supported  by CRTDUPOBJ and  *DTAQ object
types.

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

The following TAA Tools must be on your system:

     CHKALLOBJ       Check *ALLOBJ special authority
     CHKDUPLST       Check duplicate list
     CHKOBJ3         Check object 3
     CRTDUPDTAQ      Create duplicate data queue
     DLTOBJ2         Delete object 2
     EDTVAR          Edit variable
     EXTLST          Extract list
     EXTLST2         Extract list 2
     RSNLSTMSG       Resend last message
     RTVDIAGMSG      Retrieve diagnostic message
     RTVOBJLST       Retrieve object list
     SNDCOMPMSG      Send completion message
     SNDDIAGMSG      Send diagnostic message
     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
   ------        ----    ---------      ----------    ----------

   CRTDUPOBJ2    *CMD                   TAAOBKG       QATTCMD
   TAAOBKGC      *PGM       CLP         TAAOBKGC      QATTCL
   TAAOBKGR      *PGM       RPG         TAAOBKGR      QATTRPG
					

Added to TAA Productivity tools February 28, 2000


Home Page Up to Top