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

CRETDS  Cataloged  Procedure


CRETDS cataloged procedure creates and catalogs an empty disk data set (non-VSAM) using MVS Job Scheduler (IEFBR14 is a "do-nothing" dummy system program).  If the data set with the same name already exists, it gets deleted by DELTDS step prior to the creation step.

Warning!  CRETDS procedure is potentially destructive (because of the DELTDS usage) 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 CRETDS, i.e. if you are not sure how data set deletion works under MVS, please do not use CRETDS procedure at all.

Following are parameters of the CRETDS cataloged procedure:

Parameter Default Description
U 1
Number of disk units.  When data set size is unpredictable and disk space is limited, use more than '1' to avoid annoying B37 AbEnds insufficient disk space for secondary extent allocations.
V None
Volume for the data set.  When data set is created at client's site, SMS (System Managed Storage) normally will take care of the VOL.  If you are creating your private libraries, however, it might make sense to find a development VOL (usually having a name of TSOxxx; look for one with the maximum amount of free space).  If you leave this to the SMS, you might end up with all your tools gone without any warning (this happened several times to me and exactly at the moments when I needed them most).
S Required Data set full name
Memory allocation units.  It makes sense to use CYL for big data sets and TRK from average to small.  There is a further sophistication in usage of this parameter, but it has a limited application.
P 10 
Number of primary memory units (specified by the M parameter)  It should be satisfied before the job starts.  If the request for the primary disk space can't be satisfied by the MVS Job Scheduler, job gets cancelled with the a JCL error.
A 6
Number of additional memory units (specified by the M parameter)  It should be satisfied while job is running.  If the request for the additional disk space can't be satisfied by the MVS Job Scheduler in the process of job execution, job AbEnds with B37 code.  System will try to allocate up to 15 additional extents, so (10,6) parameter combination can allocate 10 times of the primary allocation:  10+6*15=10+90=100=10*10.  Another usable parameter combination is (5,3) will also allocate 10 times of the primary allocation:  5+3*5=10+45=50=5*10.  Here comes into play the U parameter.  If system can't find space on the current disk, it will try another, provided that specified number of units is more than '1'.  Specifying several units for the data set is the best way to handle the B37 AbEnd.
X None
Memory allocation unit multiplier.  A handy parameter for increasing memory being allocated by the multiple of 10.  Whatever number of zeros is specified in the X parameter it simply gets concatenated with the P and A parameter values.
D 0
Number of library directory blocks (use only in combination with O=PO).  Number of primary memory units (P) is normally a good choice for the number of library directory blocks (D).  If the nature of library data suggests that most of the partitions will be small (CONTROL data library for one example), it makes sense to double that number.
Data set organization (DSORG),  To create the library use use PO Partition Organized and specify D number of library directory blocks.
Record format (RECFM).  Fixed length Blocked (FB) format is most usable.  Other typical formats are:  F, V (Variable length), VB, FA, FBA, VA, VBA and U (Undefined length).  'A' indicates that records contain ANSI control characters (for printout control).
L 80
Record length (LRECL).  For R=U (Undefined) use L=0 this is typical for load library creation.
B 0
Block size (BLKSIZE).  It's best to use '0' (default) which is a special value it instructs the system to allocate the optimum block size for the actual unit where the data set will be allocated.

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.  CRETDS procedure provides a short one-line operator to simplify this task.

      //******  Create and Catalog Disk Data Set ------ 05/31/198210/17/1998
      //*       Copyright (C) 19821998 by Vladimir Veytsel     www.davar.net
      //CRETDS  PROC U=1,    - Number of disk units
      //             V=,     - Volume for the data set
      //             S=,     - Data set full name
      //             M=TRK,  - Memory allocation units (CYL/TRK/)
      //             P=10,   - Number of primary    memory units
      //             A=6,    - Number of additional memory units
      //             X=,     - Memory allocation unit multiplier
      //             D=0,    - Number of library directory blocks
      //             O=PS,   - Data set organization (DSORG)
      //             R=FB,   - Record format (RECFM)
      //             L=80,   - Record length (LRECL)
      //             B=0     - Block size    (BLKSIZE)
      //             SPACE=(&M,(&P&X,&A&X,&D)),DISP=(,CATLG,DELETE),
      //             DCB=(DSORG=&O,RECFM=&R,LRECL=&L,BLKSIZE=&B)

To test the CRETDS procedure create library &SYSUID..TEST.JOB by executing the job similar to the following (JCLLIB operator points to the private procedure library containing CRETDS):


To check creation results use 3.4 or 3.2 to make sure the library got created and SPACE and DCB values are correct.


                                Data Set Information
   Command ===> _________________________________________________________

   Data Set Name . . . . :  DEVVLAD.TEST.JOB

   General Data                          Current Allocation
    Management class . . :  P180Y735       Allocated tracks  . :  10
    Storage class  . . . :  STD            Allocated extents . :  1
     Volume serial . . . :  TST007         Maximum dir. blocks :  10
     Device type . . . . :  3390
    Data class . . . . . :  PDS
     Organization  . . . :  PO            Current Utilization
     Record format . . . :  FB             Used tracks . . . . :  1
     Record length . . . :  80             Used extents  . . . :  1
     Block size  . . . . :  27920          Used dir. blocks  . :  1
     1st extent tracks . :  10             Number of members . :  0
     Secondary tracks  . :  6
     Data set name type  :  PDS

     Creation date . . . :  1998/10/17     Referenced date . . :  1998/10/17  
     Expiration date . . :  ***None***

Library creation should also be confirmed by messages in the JESYSMSG output DD of SDSF (IOF, JES Master, etc.):


   IGD104I DEVVLAD.TEST.JOB                             RETAINED,  DDNAME=SYSUT  


View [and save] CRETDS.PRC text
(Use [Back] button or [Alt]+[CL] to return here from the viewed text)
Copyright © 19821998 by
Go to:  Davar site entry | Site contents | Site index | Mainframe | JCL | Text top