Create JCL to Delete Data Sets
Part Two - Challenge #11


You will learn how to create JCL to delete data sets

JCL is rarely written from scratch.

JCL is commonly copied, then modified to accomplish a task.

In this challenge an ISPF edit session is used to copy in JCL from a different member name,
then modified to accomplish a task as instructed.

Helpful Information About Deleting Data Sets

Common ways z/OS data sets are deleted include:

  • Using JCL DD parameter DISP=(OLD,DELETE) for NON-VSAM
  • Using ISPF panels
  • Using TSO delete command
  • Using system utility programs such as IDCAMS


Delete 7 unique data set types created in challenge #09
  1. Edit Z#####.JCL
  2. On the command line enter s ch11jcl to select and create a new member name, CH11JCL
    CH11JCL is empty
  3. Enter ISPF editor primary command copy ch09jcl
    CH11JCL member name now includes a copy of CH09JCL
  4. Modify JCL to delete data sets
    • Change JCL jobname from CH09JCL to CH11JCL
    • Delete JCL and control statements involved with creating the data sets
    • What should remain is 2 JCL step names, DELETE and RESULT
        Note: Modified JCL will keep the comment lines and the IF/ENDIF lines
  5. Submit modified JCL to delete the 7 data sets
      Max-RC code of 0004 is expected and normal
  6. Check CH11JCL output, specifically StepName RESULT and DDNAME SYSTSPRT, for successful deletion of 7 data sets
    • 3 ' NOT IN CATALOG ' messages for the NON-VSAM data sets
    • 4 ' LOCATE ERROR ' messages for the VSAM data sets

Actions required to complete the challenge
If SYSTSPRT DDNAME output proves the data sets were deleted,
then use XDC to print SYSTSPRT DDNAME content to P2.OUTPUT member name #11

Successful completion includes member name #11 in P2.OUTPUT with messages indicating the 7 data sets are not found.

You accomplished the challenge without example screen shots.

You demonstrated ability to use ISPF Editor, JCL, and SDSF to accomplish the challenge.

Your z/OS experience is growing. NEXT!

Next: Challenge #12