Go to:  Davar site entry | Site contents | Site index | Mainframe | JCL | Text bottom

DELTDS  Cataloged  Procedure

        

DELTDS cataloged procedure deletes [and uncatalogs] existing data set using MVS Job Scheduler (IEFBR14 is a "do-nothing" dummy system program).  When a cataloged data set gets deleted, it also gets uncataloged by the system.

Warning!  DELTDS procedure is potentially destructive and should be used with a caution and only after safe experimenting as it is described below.  If you don't have clear understanding what to expect from DELTDS, i.e.  if you are not sure how data set deletion works under MVS, please do not use DELTDS procedure at all.

Following are parameters of the DELTDS cataloged procedure:

 Parameter  Default  Description
 S  Required 
Data set full name
 V  None

Volume of specified data set.  Needed only if the data set is uncataloged.

Disposition MOD takes care of the case when data set to be deleted doesn't exist — it will be both created and deleted by this job step thus avoiding the JCL error.  SPACE and DCB parameters are necessary for this creation and their values are insignificant, provided they are syntactically valid.  Values chosen in DELTDS always provide this validity.

This simple cataloged procedure is an essential building block for other procedures and jobs — creating data sets by JCL DD operator is a common task.  Attempt to create a cataloged data set with the name already existing in the catalog results in a JCL error.  So it is a standard practice to delete a data set[s] just a step before its creation for the data output.  DELTDS cataloged procedure provides a short one-line operator to simplify this task.




     //******  Delete (and Uncatalog) Disk Data Set -- 05/31/1982–09/17/1997
     //*       Copyright (C) 1982–1997 by Vladimir Veytsel     www.davar.net
     //*
     //DELTDS  PROC S=,  - Data set full name
     //             V=   - Volume of the data set (Default:  cataloged)
     //*
     //IEFBR14 EXEC PGM=IEFBR14
     //SYSUT    DD  UNIT=SYSALLDA,VOL=SER=&V,SPACE=(TRK,0),
     //             DSN=&S,
     //             DCB=DSORG=PS,DISP=(MOD,DELETE)
  


To test the DELTDS procedure create library &SYSUID..TEST.JOB
(using 3.2 and &SYSUID..PGMR.JOB as a pattern)
and execute job similar to the following to delete it
(JCLLIB operator points to private procedure library):




   //DEVVLADT JOB CLASS=T,MSGCLASS=H,NOTIFY=&SYSUID TYPRUN=SCAN
   //PROC  JCLLIB ORDER=&SYSUID..PGMR.PROC
   //TEST    EXEC DELTDS,S=DEVVLAD.TEST.JOB
   //
            

To check deletion results use 3.4 or 3.2 to make sure library got deleted,
or browse JESYSMSG output DD of SDSF (IOF, JES Master, etc.)
and look for the messages:




   IGD103I SMS ALLOCATED TO DDNAME SYSUT
   IEF142I DEVVLADT IEFBR14 TEST - STEP WAS EXECUTED - COND CODE 0000
   IGD105I DEVVLAD.TEST.JOB                             DELETED,   DDNAME=SYSUT
            

The second submission of the above job
(data set was deleted by the first submission and doesn't exist)
will produce results similar to the following:




   IGD101I SMS ALLOCATED TO DDNAME (SYSUT   )
           DSN (DEVVLAD.TEST.JOB                            )
           STORCLAS (STD) MGMTCLAS (X010Y185) DATACLAS (SMALL)
           VOL SER NOS= TST027
   IEF142I DEVVLADT IEFBR14 TEST - STEP WAS EXECUTED - COND CODE 0000
   IGD105I DEVVLAD.TEST.JOB                             DELETED,   DDNAME=SYSUT
            

Another safe way to try the DELTDS procedure
is to submit job executing DELTDS without the S parameter.
Temporary data set will be created and deleted in the same step
and results will look similar to the following:




   IGD101I SMS ALLOCATED TO DDNAME (SYSUT   )
           DSN (SYS97215.T150623.RA000.DEVVLADT.R0659308    )
           STORCLAS (STD) MGMTCLAS (        ) DATACLAS (SMALL)
           VOL SER NOS= VIO
   IEF142I DEVUVOVT IEFBR14 TEST - STEP WAS EXECUTED - COND CODE 0000
   IGD105I SYS97215.T150623.RA000.DEVVLADT.R0659308     DELETED,   DDNAME=SYSUT
            


View [and save] DELTDS.PRC text   (Use [Back] button or [Alt]+[CL] to return here)
Go to:  Davar site entry | Site contents | Site index | Mainframe | JCL | Text top