Search code examples
ibm-midrangerpgle

What is the difference between CPYF and CRTDUPOBJ in regard to a Physical/ Logical file?


What is the difference when we use CPYF on a Pf/Lf and in case when we use command CRTDUPOBJ on PF/LF.


Solution

  • CPYF is focused on the data...

    Replace or add records . . . . .   *NONE         *NONE, *ADD, *REPLACE... 
    Create file  . . . . . . . . . .   *NO           *NO, *YES
    Copy from record number  . . . .   *START        Number, *START 
    Copy to record number  . . . . .   *END          Number, *END     
    Copy from record key:                                             
      Number of key fields . . . . .   *NONE         Number, *BLDKEY  
      Key value  . . . . . . . . . .                                  
    Copy to record key:                                               
      Number of key fields . . . . .   *NONE         Number, *BLDKEY  
      Key value  . . . . . . . . . .                                  
    Number of records to copy  . . .   *END          Number, *END 
    Include records by char test:                                              
      Field  . . . . . . . . . . . .   *NONE         Name, *NONE, *RCD, *FLD   
      Character position . . . . . .                 Number                    
      Relational operator  . . . . .                 *EQ, *GT, *LT, *NE, *GE...
      Value  . . . . . . . . . . . .                                           
    Include records by field test:                                               
      Relationship . . . . . . . . .   *NONE         *NONE, *IF, *AND, *OR       
      Field  . . . . . . . . . . . .                 Name                        
      Relational operator  . . . . .                 *EQ, *GT, *LT, *NE, *GE...  
      Value  . . . . . . . . . . . .                                             
    Record format field mapping  . .   *NONE         *NONE, *NOCHK, *CVTSRC...
    

    CRTDUPOBJ focuses on the object as a whole

    Duplicate data . . . . . . . . .   *NO    
    Duplicate constraints  . . . . .   *YES   
    Duplicate triggers . . . . . . .   *YES   
    Duplicate file identifiers . . .   *NO    
    Duplicate access control . . . .   *ALL