IDCAMS Define Cluster

IDCAMS Introduction IDCAMS Alternate Index

Advertisements


DEFINE CLUSTER to define attributes for the cluster as a whole and for the data and index components of the cluster.

The syntax of the DEFINE CLUSTER command like below:


High level syntax:

DEFINE CLUSTER (parameters) 
	 [DATA(parameters)]
	 [INDEX(parameters)]
	 [CATALOG(subparameters)]

Low level syntax:

DEFINE	CLUSTER
	  (NAME(entryname)
	  {CYLINDERS(primary[ secondary])|
	   KILOBYTES(primary[ secondary])|
	   MEGABYTES(primary[ secondary])|
	   RECORDS(primary[ secondary])|
	   TRACKS(primary[ secondary])}
	  VOLUMES(volser[ volser...])
	  [BUFFERSPACE(size)]
	  [CONTROLINTERVALSIZE(size)]
	  [ERASE|NOERASE]
	  [FREESPACE(CI-percent[ CA-percent]|0 0)]
	  [INDEXED|LINEAR|NONINDEXED|NUMBERED]
	  [KEYS(length  offset| 64 0]
	  [MODEL(entryname[ catname])]
	  [RECORDSIZE(average  maximum)]
	  [SHAREOPTIONS(crossregion[ crosssystem]|1 3)]
	  [STORAGECLASS(class)]
	  [TO(date)|FOR(days)]
	  [WRITECHECK|NOWRITECHECK])
	[DATA (
	  {CYLINDERS(primary[ secondary])|
	   KILOBYTES(primary[ secondary])|
	   MEGABYTES(primary[ secondary])|
	   RECORDS(primary[ secondary])|
	   TRACKS(primary[ secondary])}
	  [VOLUMES(volser[ volser...])]
	  [BUFFERSPACE(size)]
	  [CONTROLINTERVALSIZE(size)]
	  [ERASE|NOERASE]
	  [FILE(ddname)]
	  [FREESPACE(CI-percent[ CA-percent])]
	  [KEYS(length  offset)]
	  [MODEL(entryname[ catname])]
	  [NAME(entryname)]
	  [RECORDSIZE(average  maximum)]
	  [REUSE|NOREUSE]
	  [SHAREOPTIONS(crossregion[ crosssystem])]
	  [SPEED|RECOVERY]
	[INDEX (
	  {CYLINDERS(primary[ secondary])|
	   KILOBYTES(primary[ secondary])|
	   MEGABYTES(primary[ secondary])|
	   RECORDS(primary[ secondary])|
	   TRACKS(primary[ secondary])}
	  [VOLUMES(volser[ volser...])]
	  [CONTROLINTERVALSIZE(size)]
	  [FILE(ddname)]
	  [MODEL(entryname [ catname])]
	  [NAME(entryname)]
	  [REUSE|NOREUSE]
	  [SHAREOPTIONS(crossregion[ crosssystem])]
	[CATALOG(catname)]

DEFINE CLUSTER parameters


The DEFINE CLUSTER command uses to create the VSAM datasets and the below listed is the mandatory and optional parameters.


Mandatory parameters


CLUSTER

Cluster used to defines the cluster or re-catalogs cluster entry.

The Parameters specified with CLUSTER keyword are applied to the whole cluster that is going to create.

The parameters are enclosed [ ] are optional and remaining keywords are optional for the DATA and INDEX components.


Short Description: CL

NAME(entryname)

NAME parameter specifies/used to define the cluster's entry name or the name of each of its components.

The entryname used for the cluster as a complete and is not transmitted to the cluster's components.

entrynames can be separated for the cluster, its data component, and its index component.

If no name is specified for the data or index component, a name is generated. When the cluster, data component, and index component are individually named, each can be addressed

The name for a VSAM dataset can include up to 44 alphanumeric characters.


CYLINDERS(primary[ secondary])|
KILOBYTES(primary[ secondary])|
MEGABYTES(primary[ secondary])|
RECORDS(primary[ secondary])|
TRACKS(primary[ secondary])|

The above parameters specify the amount of space in cylinders, kilobytes, megabytes, records, or tracks allocated to the cluster from the volume's available space.

A kilobyte or megabyte allocation resolves to either tracks or cylinders; record allocation resolves to tracks.

If KILOBYTES or MEGABYTES selected, the amount of space allocated is the minimum number of tracks or cylinders required to contain the specified number of kilobytes or megabytes.

If RECORDS selected, the amount of space allocated is the minimum number of tracks that are required to contain the given number of records.

Regardless of the allocation type, The CA (control area) size will be calculated based on the smaller of the two allocation quantities (primary or secondary) in the DEFINE command but not based on the allocation type. A CA is never greater than a single cylinder, it might be less (that is, some number of tracks), depending on the allocation amount and type used.

When multiple volumes are used for a data set:


  • The first volume is defined as the prime volume. The initial allocation of a data set is on the prime volume.
  • A data set's secondary space allocation (if it is defined) is the space allocated when the primary space is filled and the data set needs additional space on the same volume.
  • CLUSTER, the space amount is divided between the data and index components. The division can be done based on the control interval size, record size, device type, and other data set attributes.
  • DATA, the entire amount specified is allocated to the data component. An additional amount of space, depending on control interval size, record size, device type, and other data set attributes, is allocated to the index component.

primary

Allocates the initial amount of space to the cluster.


secondary

Allocates an amount of space each time the cluster extends, as a secondary extent.


Short Description: CYL, KB, MB, REC, TRK

VOLUMES(volser[ volser...])

VOLUMES parameter specifies the volume name on whichVSAM needs to be created.

VOLUMES must be used either as a parameter of CLUSTER, or as a parameter of both DATA and INDEX.

Volumes are always allocated in the order specified. If there is not enough space on the volume, the allocation is not successful.


Short Description: VOL

Optional parameters


BUFFERSPACE(size)

BUFFERSPACE parameter used to specify the minimum space for buffers.

The buffer space size used by the VSAM to determine the data component's and index component's control interval size.

If BUFFERSPACE is not provided, VSAM attempts to get enough space to contain two data component control intervals and one index component control interval if the data is key sequenced.


size

The size cannot be less than enough space to contain two data component control intervals and, if the data is key sequenced, one index control interval.


Short Description:  BUFSP or BUFSPC

CONTROLINTERVALSIZE(size)

CONTROLINTERVALSIZE parameter specifies the size of the control interval for the cluster or component.

If CONTROLINTERVALSIZE is given on the cluster level, it transmits to the component level at which no CONTROLINTERVALSIZE has been specified.

The size of the control interval depends on the maximum size of the data records and the amount of buffer space provided in cluster definition.

If CONTROLINTERVALSIZE is not coded, VSAM determines the size of control intervals.


size

Indicates a cluster's data and index component size.


Short Description: CISZ or CNVSZ

ERASE|NOERASE

ERASE|NOERASE used to specify the cluster's components are to be erased/No erase when its entry in the catalog is deleted.


ERASE

ERASE parameter overwrites each component of the cluster with binary zeros when its catalog entry is deleted


Short Description: ERAS

NOERASE

NOERASE parameter specifies that each component of the cluster is not to be overwritten with binary zeros.


Short Description: NERAS

FILE(ddname)

FILE parameter names the DD statement that identifies and allocates the volumes that must be available for space allocation on the volumes specified by the VOLUMES keyword.

If more than one volume is specified, all volumes must be the same device type.

If the FILE parameter is not specified, an attempt is made to dynamically allocate the required volumes.


Restriction:

When FILE refers to multi-volume of the same device type, the DD statement that describes the volumes cannot be a concatenated DD statement.


FREESPACE(CI-percent[ CA-percent]|0 0)

FREESPACE specifies the percentage of each control interval and control area to be set as free space when the cluster is initially loaded or when a mass insert is done.

CI-percent is a percentage of the amount of space to be kept a side for adding new records and updating existing records with an increase in the length of the record.

CI-percent is the number of bytes that is equal to, or slightly less than, the percentage value of CI-percent.

CA-percent is the number of control intervals equal to, or less than, the percentage of CA-percent.

CI-percent and CA-percent must be equal to, or less than, 100.


Short Description: FSPC

INDEXED|LINEAR|NONINDEXED|NUMBERED

The above parameter is used to specify the type of data organization for the cluster.

If the parameter not specified the default organization is INDEXED (the default).

The organization must be specified when a cluster is defined whether the data is to be indexed (key sequenced), nonindexed (entry sequenced), numbered (relative record), or linear.

Linear data set clusters are treated as ESDS clusters that must be processed using control interval access.

If you want to define an entry-sequenced or a relative record cluster, must specify the NONINDEXED, the NUMBERED, or the MODEL parameter.


INDEXED

INDEXED parameter specifies that the cluster being defined is for key-sequenced data.

If INDEXED is specified, an index component is automatically defined and cataloged. The data records can be accessed by key or by relative-byte address (RBA).


Short Description: IXD

LINEAR

Short Description: LIN

NONINDEXED

NONINDEXED parameter indicates that the cluster being defined is for entry-sequenced data.


Short Description: NIXD

NUMBERED

NUMBERED parameter specifies that the cluster's data organization is for relative record data.


Short Description: NUMD

KEYS(length offset|64 0)

KEYS parameter specifies the information about the prime key field of a key-sequenced data set's data records.

This parameter overrides any KEYS specification in the DATACLASS parameter.


length offset

Specifies the length of the key and its displacement (in bytes) from the beginning of the record.

The sum of length plus offset cannot exceed the length of the shortest record.


MODEL(entryname[ catname])

MODEL parameters used to specify an existing entry to be used as a model for the entry being defined.

The DATACLASS, MANAGEMENTCLASS, and STORAGECLASS attributes are not modeled.


entryname

Specifies the name of the cluster or component entry to be used as a model.


catname

Names the model entry's catalog.


RECORDSIZE(average maximum|default)

RECORDSIZE specifies the average and maximum lengths, in bytes, of the records in the data component. The minimum record size is 1 byte.

RECORDSIZE can be given as a parameter of either CLUSTER or DATA.

This parameter overrides the LRECL specification on the DATACLASS parameter.

MAXLRECL = CI/CA * (CISZ - 10)


Short Description: RECSZ

SHAREOPTIONS(crossregion[ crosssystem]|1 3)

SHAREOPTIONS parameter specifies the sharing options of how a component or cluster can be shared among users.

The value of SHAREOPTIONS is assumed to be (3,3) when the data set is accessed in VSAM


crossregion

crossregion specifies the amount of sharing allowed among regions within the same system or within multiple systems using global resource serialization (GRS).


OPT 1

The data set can be shared by any number of users for read processing, or the data set can be accessed by only one user for read and write processing.


OPT 2

The data set can be accessed by any number of users for read processing, and it can also be accessed by one user for write processing.


OPT 3

The data set can be fully shared by any number of users. Each user is responsible for maintaining both read and write integrity for the data the program accesses.


OPT 4

The data set can be fully shared by any number of users.


crosssystem

crosssystem option specifies the amount of sharing allowed among systems.


OPT 1

Reserved


OPT 2

Reserved


OPT 3

OPT 3 specifies that the data set can be fully shared. With this option, each user is responsible for maintaining both read and write integrity for the data that user's program accesses.


OPT 4

OPT 4 indicates that the data set can be fully shared. For each request, VSAM refreshes the buffers used for direct processing.


Short Description: SHR


SPEED|RECOVERY

SPEED|RECOVERY parameter specifies whether the data component's control areas are to be preformatted before alternate index records are loaded into them.

This parameter is only considered during the actual loading (creation) of a data set.


SPEED

Speed parameter does not preformat the data component's space.


RECOVERY

RECOVERY parameter specifies that the data component's control areas are written with records that indicate end-of-file.

RECOVERY is a way to verify storage that is used on the device for each CA before the data is actually written.


Short Description: RCVY

TO(date)|FOR(days)

TO/FOR parameters specifies the retention period for the cluster being defined. If neither TO nor FOR is used, the cluster can be deleted at any time.


TO(date)

TO parameter specify the date up to which to keep the cluster before it is allowed to be deleted.

The date is given in the form [yy]yyddd, in which yyyy is a four-digit year, yy is a two-digit year, and ddd is a three-digit day of the year (001 through 366).


FOR(days)

FOR parameter shows the number of days to keep the cluster being defined.

The maximum number is 9999.

If the number is 0 through 9998, the cluster is retained for the number of days; if the number is 9999, the cluster is retained indefinitely.


WRITECHECK|NOWRITECHECK

WRITECHECK|NOWRITECHECK parameters indicates whether the cluster or component is to be checked by a machine action called write check when a record is written into it.


WRITECHECK

WRITECHECK parameter shows that a record is written and then r-ead, without data transfer, to test for the data check condition.


Short Description: WCK


NOWRITECHECK

NOWRITECHECK parameter specifies that the cluster or component is not to be checked by a write check.


Short Description: NWCK


Practical Example - KSDS- JCL for creating KSDS dataset:

						
//JOB CARD
//*------------------------------------------------------------------
//* Definition of KSDS
//*------------------------------------------------------------------
//STEP01  EXEC PGM=IDCAMS
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD *
    DEFINE CLUSTER 				-
       (NAME(userid.CLUSTER.NAME) 		–
	CYLS(4 1)  				-
       	VOL(XXXXXX) 				–
	BUFFERSPACE(20) 			–
	CONTROLINTERVALSIZE(4096) 		–
	FREESPACE(10 20) 			–
	KEYS(10 2) 				–
	RECORDSIZE(75 50) 			–
	SHAREOPTIONS(1 3) 			-
	TO(2050360) 				-
        INDEXED 				-
        NOREUSE 				-
        OWNER(userid) ) 			-
      DATA 					-
        (NAME(userid.CLUSTER.NAME.DATA)) 	-
      INDEX 					-
        (NAME(userid.CLUSTER.NAME.INDEX))	-
      CATALOG(XXXXXX)

/*


Practical Example - ESDS- JCL for creating ESDS dataset:

						
//JOB CARD
//*------------------------------------------------------------------
//* Definition of ESDS
//*------------------------------------------------------------------
//STEP01  EXEC PGM=IDCAMS
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD *
    DEFINE CLUSTER 				-
       (NAME(userid.CLUSTER.NAME) 		–
	CYLS(4 1)  				-
       	VOL(XXXXXX) 				–
	BUFFERSPACE(20) 			–
	CONTROLINTERVALSIZE(4096) 		–
	FREESPACE(10 20) 			–
	RECORDSIZE(75 50) 			–
	SHAREOPTIONS(1 3) 			-
	TO(2050360) 				-
        NONINDEXED 				-
        NOREUSE 				-
        OWNER(userid) ) 			-
      DATA 					-
        (NAME(userid.CLUSTER.NAME.DATA)) 	-
      CATALOG(XXXXXX)

/*


Practical Example - RRDS- JCL for creating RRDS dataset:

						
//JOB CARD
//*------------------------------------------------------------------
//* Definition of RRDS
//*------------------------------------------------------------------
//STEP01  EXEC PGM=IDCAMS
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD *
    DEFINE CLUSTER 				-
       (NAME(userid.CLUSTER.NAME) 		–
	CYLS(4 1)  				-
       	VOL(XXXXXX) 				–
	BUFFERSPACE(20) 			–
	CONTROLINTERVALSIZE(4096) 		–
	FREESPACE(10 20) 			–				–
	RECORDSIZE(75 50) 			–
	SHAREOPTIONS(1 3) 			-
	TO(2050360) 				-
        NUMBERED 				-
        NOREUSE 				-
        OWNER(userid) ) 			-
      DATA 					-
        (NAME(userid.CLUSTER.NAME.DATA)) 	-
      CATALOG(XXXXXX)

/*

Practical Example - LDS- JCL for creating LDS dataset:

						
//JOB CARD
//*------------------------------------------------------------------
//* Definition of LDS
//*------------------------------------------------------------------
//STEP01  EXEC PGM=IDCAMS
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD *
    DEFINE CLUSTER 				-
       (NAME(userid.CLUSTER.NAME) 		–
	CYLS(4 1)  				-
       	VOL(XXXXXX) 				–
	BUFFERSPACE(20) 			–
	CONTROLINTERVALSIZE(4096) 		–
	FREESPACE(10 20) 			–				–
	RECORDSIZE(75 50) 			–
	SHAREOPTIONS(1 3) 			-
	TO(2050360) 				-
        LINEAR	 				-
        NOREUSE 				-
        OWNER(userid) ) 			-
      DATA 					-
        (NAME(userid.CLUSTER.NAME.DATA)) 	-
      CATALOG(XXXXXX)

/*


IDCAMS Introduction IDCAMS Alternate Index

Advertisements