CPF3219 - Cannot delete file or member ...

By kimot, 5 October, 2023
                        Additional Message Information                        
                                                                              
Message ID . . . . . . :   CPF3219                                            
Date sent  . . . . . . :   05/10/23      Time sent  . . . . . . :   12:23:15  
                                                                              
Message . . . . :   Cannot delete file or member of file FILE_NAME in LIBRARY.    
                                                                              
Cause . . . . . :   If a member was referred to, the member name is           
  MBR_NAME. If this is a delete operation, file FILE_NAME in library LIBRARY or 
  a member of file FILE_NAME was not deleted because dependent files or members
  are based on either the file or the member. If this is a restore operation, 
  a problem occurred preventing a successful restore of file FILE_NAME in      
  library LIBRARY. This problem occurred after the restore operation had already 
  created the file in preparation for the load of the file's data from media. 
  The restore operation was not able to delete this unsuccessfully restored   
  file because dependent files or members are based on either the file or the 
  member.                                                                     

If you get this message when you want to delete physical file member. It's possible that a logical file is linked to this physical file. 

You can find out which files are linked via this command

DSPDBR FILE(LIBRARY/FILE_NAME)

And in spool file you can find results

Files Dependent On Specified File                                     
  Dependent File         Library       Dependency   JREF    Constraint
      FILE_1             LIBRARY1      Data            1              
      FILE_2             LIBRARY2      Data            1              

Then you can try first to delete member with same name in joined logical files

RMVM FILE(LIBRARY1/FILE_1) MBR(MEMBER)