IDCAMS Define Alternate Index

IDCAMS Alternate Index IDCAMS Define Path

Advertisements


Alternate Index declaration can be defined like below.


High level Syntax:

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


Detail level Syntax:


DEFINE ALTERNATEINDEX
	  (NAME(entryname)
	  RELATE(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)]
	  [KEYS(length   offset|64 0)]
	  [MODEL(entryname[ catname])]
	  [RECORDSIZE(average   maximum| 4086 32600)]
	  [REUSE|NOREUSE]
	  [SHAREOPTIONS(crossregion[ crosssystem]| 1 3)]
	  [SPEED|RECOVERY]
	  [TO(date)|FOR(days)]
	  [UNIQUEKEY|NONUNIQUEKEY]
	  [WRITECHECK|NOWRITECHECK])
	[DATA (
	  {CYLINDERS(primary[ secondary])|
	   KILOBYTES(primary[ secondary])|
	   MEGABYTES(primary[ secondary])|
	   RECORDS(primary[ secondary])|
	   TRACKS(primary[ secondary])}
	  [VOLUMES(volser[ volser...])]
	  [ATTEMPTS(number)]
	  [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]
	  [UNIQUEKEY|NONUNIQUEKEY]
	  [WRITECHECK|NOWRITECHECK])]
	[INDEX (
	  {CYLINDERS(primary[ secondary])|
	   KILOBYTES(primary[ secondary])|
	   MEGABYTES(primary[ secondary])|
	   RECORDS(primary[ secondary])|
	   TRACKS(primary[ secondary])}
	  [VOLUMES(volser[ volser...])]
	  [ATTEMPTS(number)]
	  [CONTROLINTERVALSIZE(size)]
	  [MODEL(entryname[ catname ])]
	  [NAME(entryname)]
	  [REUSE|NOREUSE]
	  [SHAREOPTIONS(crossregion[ crosssystem])]
	  [WRITECHECK|NOWRITECHECK])]
	[CATALOG(catname)]

UNIQUEKEY|NONUNIQUEKEY

UNIQUEKEY|NONUNIQUEKEY parameter specifies that whether more than one data record can contain the same key value for the alternate index.


UNIQUEKEY

UNIQUEKEY parameter used to define the alternate index is unique key and no duplicate keys allowed. While building the alternate index for the dataset and if more than one data record contains the same key value for the alternate index, the BLDINDEX processing ends with an error message.


Short Description: UNQK

NONUNIQUEKEY

NONUNIQUEKEY parameter used to define the alternate index is nonunique key and duplicate keys allowed.


Short Description: NUNQK

Practical Example:


						
//JOB CARD
//*------------------------------------------------------------------
//* Define unique AIX
//*------------------------------------------------------------------
//STEP01  EXEC PGM=IDCAMS
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD *
    DEFINE AIX 					-
        (NAME(userid.KSDS.ALTIDX) 		-
        RECORDS(100)  				-
        KEYS(10,0)    				-
        VOL(XXXXXX)  				-
        UNIQUEKEY 				-
        RELATE(userid.KSDS.CLUSTER)) 		-
      DATA 					-
        (NAME(userid.KSDS.ALTIDX.ALTDATA)) 	-
      INDEX 					-
        (NAME(userid.KSDS.ALTIDX.ALTINDEX))
/*


IDCAMS Alternate Index IDCAMS Define Path

Advertisements