Each record in the data component
of a KSDS cluster contains a key field, which must be the same number of
characters and occur in the same relative position in each record. The
records are stored in the data component in logical sequence based upon their
key field value. The index component of the KSDS cluster contains the
list of key values for the records in the cluster with pointers to the
corresponding records in the data component. The records in a KSDS may be
accessed sequentially, in order by key value, or directly, by supplying the key
value of the desired record. The records of a KSDS cluster may be fixed
length or variable length. Records may be added or deleted at any point
within a KSDS cluster, and the affected record is inserted or removed, and the
surrounding records will be reorganized as required to maintain the correct
The following jobstream will define a Key Sequenced cluster.
//DEFCLUSK JOB 'JAY MOSELEY',CLASS=A,MSGLEVEL=(1,1),MSGCLASS=A //IDCAMS EXEC PGM=IDCAMS,REGION=4096K //SYSPRINT DD SYSOUT=A //SYSIN DD * /* DELETE KSDS CLUSTER, IF IT EXISTS */ DELETE MVS801.STUDENT.FILE CLUSTER PURGE /* DEFINE KSDS CLUSTER */ DEFINE CLUSTER ( - NAME(MVS801.STUDENT.FILE) - VOLUMES(MVS801) - RECORDSIZE(80 80) - RECORDS(50 10) - KEYS(10 0) - INDEXED ) - DATA ( - NAME(MVS801.STUDENT.FILE.DATA) ) - INDEX ( - NAME(MVS801.STUDENT.FILE.INDEX) ) IF LASTCC = 0 THEN - LISTCAT ALL LEVEL(MVS801.STUDENT) /* //
Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!