JCL SPACE Parameter & Examples

JCL SPACE Parameter is one of the important parameters to be specified for a NEW dataset which request the storage required for that dataset on a Direct Access Volume. SPACE Parameter in JCL is an Optional Keyword parameter that indicates the OS, the amount of memory allocation needed for a dataset while creating it and indicates the allocation units that the requested memory to be provided in.

SPACE allocation can be requested in two ways

Instruct the system on how much space is required, so that System assigns the specific tracks required.
Instruct the system on the specific tracks that needs to be allocated to a data set.

It can be allocated in Tracks(TRK), Cylinders(CYL) and in record blocks. Lets have a look at each one of them.

Tracks – Track is part of a DISK which stores the fixed amount of storage. In storage DISKs are mounted on each other
where as each DISJ consists of concentric circles called Tracks.

Cylinders – Cylinders are the group of concentric Tracks on a disk.

Blocks – It is the number of bytes on a storage device.

Syntax:

SPACE=({Allocation Units,}(Primary Qnty[,Secondary Qnty][,directory blks])[,RLSE]
       [,memory allocation way][,ROUND]

Allocation Units –> It indicates in which units the required storage needs to be allocated. Valid units are TRK, CYL, blklgth & reclgth.

Primary Qnty     –> This is the primary quantity of storage to be allocated. Value can be 0 to 16777215.

Secondary Qnty –> This is the secondary quantity of storage to be allocated.Value can be 0 to 16777215.

Directory             –> Number of directory blocks required. Specify this for PDS datasets.

RLSE                    –> it indicates to release the unused space that got allocated.
memory allocation way –> This parameter indicates how the given space should be allocated whether it should be in contiguous. It is an optional sub parameter where it allows CONTIG,MXIG,ALX as the values.

CONTIG               –> It specifies that the space allocated should be contiguous.It has effect only on primary allocation. If CONTIG  is specified and contiguous space is not available, then the system terminates the job step.

MXIG                    –> this also indicates the Contiguous space to be allocated but here the difference is it indicates the system that  the space to be allocated must be the largest area of available contiguous space on the volume. This also effects the Primary allocation.

Round                   –> It indicates that the entire cylinder to be allocated for the dataset.

SPACE= ({TRK,}(primary-qty[,second-qty][,directory])[,RLSE][,CONTIG][,ROUND])
({CYL,}                   [,          ]             [,    ][,MXIG  ]
({blklgth,}                                                [,ALX   ]
({reclgth,}                                                [,      ]

Examples of JCL SPACE parameter

1. (CYL,(5,5))
Here the allocation of storage must be in Cylinders. Primary Quantity is 5 and if the primary quantity becomes Full then allocate 5 extents of secondary quantity.

2. (TRK,(5,1),RLSE)

Here the allocation is to be done in Tracks where as the primary quantity os 5 and if it exhausts then allocate the secondary quantity of 1. RLSE states that release the unused space upon closing the file.

3. (CYL,(10,5,6),,CONTIG)

As the directory blocks of 6 is specified this is for a PDS. CONTIG requests for a contiguous 10 cylinders of primary space.

4. (CYL,10)
All other sub parameters are optional so the Space parameter can be simplified as above where only primary quantity can be specified. TRK also can be used instead of CYL.

5. (150,(100,50))

Here the storage requested is in blocks of 150 bytes. So it requests a 100 blocks of 150 bytes for Primary and 50

More On Space:

  • Where the OS looks whether any space is available on particular Direct Access Device?
    Each Direct access device maintains a VTOC (Volume Table of Contents) where it consists of the datasets that are stored on that volume and Free space available for use. So for any new storage requests, first VTOC is scanned to check for the storage availability.
  • Storage allocation in Track  is device dependent so it may vary across the devices. As an example One Track on 3390 device consists of 56,664 bytes.
  • Smaller data-sets are generally allocated in Tracks.
  • Cylinders are also device dependent just like Tracks.
  • Larger data-sets are generally allocated in Cylinders.
  • Cylinders are considered to be accessed faster than tracks as positioning of data on Tracks is bit slower thus reading becomes slow.
  • Blocks are independent of device type. BLKSIZE parameter of DCB decides on how many bytes are assigned to one block. One thing to be noted is, even though the space is requested in blocks, internally space is allocated in equivalent tracks.
  • Secondary space allocated may not be in contiguous to the Primary space allocated. It can be allocated in another place. So secondary space generally allocated in non-contiguous space on that volume. These non-contiguous tracks are named as Extents. Upto 15 extents are possible on a particular volume if more than that is required than another volume must be used.

 

Add a Comment

Your email address will not be published. Required fields are marked *