Delete data sets

With ZOAU, you can delete all datasets that start with ${prefix} and end with GRE followed by any character with any of the following ways:

  • Issuing a shell command:

    drm "${prefix}.*GRE?"
    
  • Calling an API in Python programs:

    datasets.delete("%s.*GRE?" % HLQ)
    

Without ZOAU, to achieve the same purpose, you need to write the following JCL statements:

//*
//* Delete the dataset @@HLQ@@.ZOASAMP.NOT.WANTED
//* Returns 0 if the dataset was successfully deleted
//* (or if it didn't exist). 
//*
//DRM   EXEC PGM=IEFBR14
//DELDD DD DSN=@@HLQ@@.ZOASAMP.NOT.WANTED,                             +
//      DISP=(MOD,DELETE,DELETE),SPACE=(TRK,1)