📜  VSAM-群集

📅  最后修改于: 2020-11-22 17:20:04             🧑  作者: Mango


VSAM群集在JCL中定义。 JCL使用IDCAMS实用程序创建集群。 IDCAMS是IBM开发的一种实用程序,用于访问方法服务。它主要用于定义VSAM数据集。

定义集群

以下语法显示了主要参数,这些主要参数分组在Define Cluster,DataIndex下

.DEFINE CLUSTER (NAME(vsam-file-name)      -
BLOCKS(number)                             -
VOLUMES(volume-serial)                     -
[INDEXED / NONINDEXED / NUMBERED / LINEAR] -
RECSZ(average maximum)                     -
[FREESPACE(CI-Percentage,CA-Percentage)]   -
CISZ(number)                               -
[KEYS(length offset)]                      -
[READPW(password)]                         -
[FOR(days)|TO(date)]                       -
[UPDATEPW(password)]                       -
[REUSE / NOREUSE] )                        -
DATA                                       -
   (NAME(vsam-file-name.data))             -
INDEX                                      -
   (NAME(vsam-file-name.index))            -
CATALOG(catalog-name[/password]))            

CLUSTER级别的参数适用于整个集群。 DATA或INDEX级别的参数仅适用于数据或索引组件。

我们将在下表中详细讨论每个参数-

Sr.No Parameters with Description
1

DEFINE CLUSTER

Define Cluster command is used to define a cluster and specify parameter attributes for the cluster and its components.

2

NAME

NAME specifies the name of VSAM file for which we are defining the cluster.

3

BLOCKS

Blocks specifies the number of blocks assigned for the cluster.

4

VOLUMES

Volumes specifies one or more volumes that will contain the cluster or component.

5

INDEXED / NONINDEXED / NUMBERED / LINEAR

This parameter can take three values INDEXED, NONINDEXED or NUMBERED depending upon the type of dataset we are creating. For key-sequenced(KSDS) files INDEXED option is used. For entry-sequenced(ESDS) files the NONINDEXED option is used. For relative-record(RRDS) files the NUMBERED option is required. For Linear(LDS) files the LINEAR option is required. The default value of this parameter is INDEXED. We will discuss more about KSDS, ESDS, RRDS and LDS in coming modules.

6

RECSZ

Record Size parameter has two values which are Average and Maximum record size. The Average specifies the average length of the logical records in the file and the Maximum denotes the length of the records.

7

FREESPACE

Freespace specifies the percentage of free space to reserve for the control intervals (CI) and control areas (CA) of the data component. The default value of this parameter is zero percentage.

8

CISZ

CISZ is known as Control interval size. It specifies the size of control intervals.

9

KEYS

Keys parameter is defined only in key-sequenced (KSDS) files. It specifies the length and offset of primary key from first column. The range of value of this parameter are from 1 to 255 bytes.

10

READPW

Value in READPW parameter specifies the password of read level.

11

FOR/TO

The value of this parameter specifies the amount of time in terms of date and days for retaining the file. The default value for this parameter is zero days.

12

UPDATEPW

Value in UPDATEPW parameter specifies the password of update level.

13

REUSE / NOREUSE

REUSE parameter allows clusters to be defined that may be reset to empty status without deleting and re-defining them.

14

DATA – NAME

The DATA part of the cluster contains the dataset name which contains the actual data of the file.

15

INDEX-NAME

The INDEX part of the cluster contains the primary key and the memory pointer for the corresponding record in the data part. It is defined when a Key Sequenced cluster is used.

16

CATALOG

Catalog parameter denotes the catalog under which the file will be defined. We will discuss about catalog separately in upcoming modules.

以下是显示如何在JCL中定义集群的基本示例-

//SAMPLE JOB(TESTJCL,XXXXXX),CLASS = A,MSGCLASS = C
//STEP1  EXEC PGM = IDCAMS
//SYSPRINT DD  SYSOUT = *
//SYSIN    DD  *
   DEFINE CLUSTER (NAME(MY.VSAM.KSDSFILE)  -
   INDEXED                                 -
   RECSZ(80 80)                            -
   TRACKS(1,1)                             -
   KEYS(5  0)                              -
   CISZ(4096)                              -                            
   FREESPACE(3 3) )                        -
   DATA (NAME(MY.VSAM.KSDSFILE.DATA))      -
   INDEX (NAME(MY.VSAM.KSDSFILE.INDEX))
/*

如果要在大型机服务器上执行上述JCL。它应以MAXCC = 0执行,并将创建MY.VSAM.KSDSFILE VSAM文件。

删除集群

要删除VSAM文件,需要使用IDCAMS实用工具删除VSAM群集。 DELETE命令从目录中删除VSAM群集的条目,并有选择地删除文件,从而释放对象占用的空间。如果VSAM数据集未过期,则不会删除它。要删除此类数据集,请使用PURGE选项。

DELETE data-set-name CLUSTER  
[ERASE / NOERASE] 
[FORCE / NOFORCE] 
[PURGE / NOPURGE] 
[SCRATCH / NOSCRATCH]

上面的语法显示了我们可以与Delete语句一起使用的参数。我们将在下表中详细讨论它们-

Sr.No Parameters with Description
1

ERASE / NOERASE

ERASE option is specified to override the ERASE attribute specified for the object in the catalog. NOERASE option is taken by default.

2

FORCE / NOFORCE

FORCE option is specified to delete the SPACE and USERCATALOG even if they are not empty. NOFORCE option is taken by default.

3

PURGE / NOPURGE

PURGE option is used to delete the VSAM dataset if dataset has not expired. NOPURGE option is taken by default.

4

SCRATCH / NOSCRATCH

SCRATCH option is specified to remove the associated entry for the object from the Volume Table of Contents. It is mainly used for non-vsam datasets like GDGs. NOSCRATCH option is taken by default.

以下是显示如何在JCL中删除集群的基本示例-

//SAMPLE JOB(TESTJCL,XXXXXX),CLASS = A,MSGCLASS = C
//STEPNAME EXEC PGM = IDCAMS
//SYSPRINT DD  SYSOUT = *
//SYSIN    DD  *
   DELETE MY.VSAM.KSDSFILE CLUSTER
    PURGE
/*

如果要在大型机服务器上执行上述JCL。它应以MAXCC = 0执行,并将删除MY.VSAM.KSDSFILE VSAM文件。