Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 3: Access Method Services (AMS)


Defining KSDS

  • What is KSDS? Please refer Module 2 <LINK>
  • KSDS cluster can be defined using DEFINE CLUSTER command which is explained along with Syntax in 'IDCAMS DEFINE CLUSTER Command' section. <LINK>
  • Below is the most basic Syntax for defining KSDS cluster:-
    DEFINE CLUSTER - ( NAME(ksds-file-name) - CYLINDERS ( primary[ secondary] ) - VOLUMES ( volser1 [volser2...] ) - [CONTROLINTERVALSIZE ( size ) ] - [FREESPACE ( CI-percent [CA-percent] | 0 0 ) ] - INDEXED - [KEYS ( length offset | 64 0 ) ] - [RECORDSIZE ( average maximum ) ] ) - [ DATA - ([NAME(ksds-file-name.DATA)]) ] - [ INDEX - ([NAME(ksds-file-name.INDEX)]) ]
  • Meaning of each of above parameters and other few more parameters(which are not included in above Simplified Syntax) can be referred in ‘IDCAMS- DEFINE CLUSTER command’ Section <LINK>
  • INDEXED parameter must be coded in DEFINE CLUSTER command to instruct VSAM that the cluster is KSDS.
  • Below JCL example depicts the creation of KSDS cluster:-
    //DEPTJOB JOB A123,’STEVE’ //KSDSDFN EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * DEFINE CLUSTER(NAME(PAYT.PAYROLL.PRCSKSDS.MSTR) - CYLINDERS (5 1) - VOLUME(VSMP91) - CONTROLINTERVALSIZE(4096) - FREESPACE(15 10) - INDEXED - KEYS(30 00) - RECORDSIZE(382 382) ) - DATA( - NAME(PAYT.PAYROLL.PRCSKSDS.MSTR.DATA)) - INDEX( - NAME(PAYT.PAYROLL.PRCSKSDS.MSTR.INDEX))
  • Description:- Above job will create VSAM KSDS cluster since INDEXED is specified as type of cluster. It will be created with name ‘PAYT.PAYROLL.PRCSKSDS.MSTR’ along with DATA component having name ‘PAYT.PAYROLL.PRCSKSDS.MSTR.DATA’ and INDEX component having name ‘PAYT.PAYROLL.PRCSKSDS.MSTR.INDEX’. This cluster will be created on volume ‘ VSMP91’. 5 cylinders of primary and 1 cylinders of secondary space will be allocated. The size of control interval specified is 4096 bytes. 15% of each CI will be retained as frees space and 10% of all CIs within a control area will be left unused. Primary key of this KSDS is 30 bytes long and in file it starts at position 0. Average and maximum records length specified as 382 bytes each which indicates, KSDS contains Fixed length records .






© copyright mainframebug.com
Privacy Policy