/* +
*************************************************************** +
** - Source Member: GCRTDUPOBJ +
*************************************************************** +
** - CL Example - Using *LIBL with the CRTDUPOBJ command +
** - to create files. +
** +
** - Jon Vote 09/2002 +
** - www.idioma-software.com +
*************************************************************** +
** +
** - 'Thought shalt not qualify' is a worthy commandment +
** - but creating duplicate objects is a problem because the +
** - CRTDUPOBJ command does not allow *LIBL as the library +
** - parameter. This program shows you how to work around this. +
** - This allows your test and production systems to be +
** - identical, while using different libraries for CRTUPOBJ +
** - functions. +
*/
pgm parm(&FromObj &ToObj)
dcl &FromObj *char 10
dcl &ToObj *char 10
dcl &Lib *char 10 /* This will store the library */
/* +
** - This code will create the object in the same library as +
** - the source object. +
** - First of all, get the library containing the from object: +
*/
rtvmbrd file(*libl/&FromObj) rtnlib(&Lib)
/* +
** - Now create the new object in this library +
*/
crtdupobj obj(&FromObj) fromlib(*libl) tolib(&Lib) objtype(*file) +
newobj(&ToObj)
endpgm