Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Different result between CPYF and CRTDUPOBJ

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Different result between CPYF and CRTDUPOBJ

    Occasionally we use a utility to restore deleted records from a database file, to fix a problem or just for research. Sometimes for a file we want to only UN-delete a handful of records and there are several thousand deleted records in the file. So...we don't want to run this over our production file, we copy the file out to another library, undelete all of the records and then copy the small handful of records that we really needed back into the production file. Here is where things get interesting. If you have a physical file with some deleted records, and you try to duplicate it a couple of the most common methods to use are the CPYF and the CRTDUPOBJ. When we use the CRTDUPOBJ, the deleted records in the resulting file are fine. When we use the CPYF method (with the option to keep deleted records), the deleted records in the new copied file are all initialized. What is the difference between CRTDUPOBJ and CPYF in how the deleted records are created in the duplicated file? The reason for the question, is that if you want to create a duplicate of a heavily used file the CRTDUPOBJ is usually not a valid option because it has to be able to allocate the file exclusively in order to be able to create the duplicate object. Also as another alternative which we haven't tried yet, we could save the file and then restore it back into the duplicate environment...perhaps this would preserve the deleted records. But we're still curious about the different results we get with the deleted records between the CRTDUPOBJ and the CPYF. Does anyone know the reason why this difference occurs? Thanks - Mike

  • #2
    Different result between CPYF and CRTDUPOBJ

    Because CRTDUPOBJ deals with an object, and CPYF deals with records. CPYF does not see the deleted records just like an RPG program won't seem them. CRTDUPOBJ tries to make an exact copy of the object, even the user authorities to it. I don't have a solution for you. Chris

    Comment

    Working...
    X