CL400 (CRTDUPOBJ) - skill-at/AS-400-Training GitHub Wiki
CRTDUPOBJ:-
The Create Duplicate Object (CRTDUPOBJ) command copies a single object or a group of objects.The new object must be renamed if it is created in the library that contains the original object. The newly-created object can retain the name of the original object if it is created in a library different than the one that contains the original object. You can copy a group of related objects by specifying a generic object name or by specifying *ALL or more than one object type. When copying a group of related objects, you must specify a different library in which the new objects are created. You can specify whether data in physical files or save files is copied with duplicate data parameter.
Example :
In this ACNTPF will be duplicated from DATALIB into DATABKPLIB and data will be retained. CRTDUPOBJ OBJ(ACNTPF) FROMLIB(DATALIB) OBJTYPE(*FILE) + TOLIB(DATABKPLIB) NEWOBJ(*SAME) DATA(*YES)