xvsamCreate

Top  Previous  Next

xvsamCreate creates the definition for a new base cluster in the catalog. It creates only a definition, so that data set remains empty until it has been filled up by means of the xvsamImport function. During the creation, the primary key and all the secondary key records are written in both files Catalog.dat and Catalog.idx, and the correspondent C-ISAM components - vsamfile.idx and vsamfile.dat are created and initialized too.

For this reason you are no longer requested to build up explicitly the alternate indices relative to a base cluster by means of the BLDINDX feature of IDCAMS.

xvsamCreate reads the launch parameters from standard input, line after line until the end-of-data indicator is encountered or you interrupt it by means of <CTRL+D>. That allows you to group together the creation of more than one base cluster or alternate index path within a single xvsamCreate command.

Its functionality corresponds to those of the IDCAMS statements:

DEFINE CLUSTER
DEFINE ALTERNATE INDEX
DEFINE PATH

Syntax

xvsamCreate

Standard input format for clusters is the following:

C <catalog> <NAME> <path> (K|R|E) (F|V) <min> <max> <nk> <koff> <klen> <name> <Y|N>

while for alternate indexes is:

A <catalog> <NAME> <primary> (D|U) <nk> <koff> <klen>

Parameters

C|A

function code, mandatory operand:

   C Define Cluster

   A Define alternate index path

catalog

name of the catalog

NAME

name of the cluster or the alternate index path, in uppercase, that is to be created

path

physical path under $XVSAM, where the file is to be created

primary

name of the associated base cluster; to be supplied only in case of Define Alternate index path

K|R|E

file organization: KSDS, RRDS or ESDS; to be supplied only in case of Define Cluster

F|V

record type: Fixed or Variable record length; to be supplied only in case of Define Cluster

min

minimum record size. If zero or nothing is entered for minimum record size, then xvsamCreate calculates it automatically, on the base of the key lengths (primary and secondary). This is due to the fact the C-ISAM puts all keys in the fixed part of the record. This value is required only in case of Define Cluster

max

maximum record size; to be supplied only in case of Define Cluster

nk

number of parts composing the key

koff

key offset; it represents the displacement of the key field from the beginning of the record, relative to zero

klen

it represents the length of the key

name

name of the cluster or the alternate index path, in lowercase, that is to be created

Y|N

Reuse/No reuse flag. Y (yes) OPEN OUTPUT of non-empty files is allowed; N (no) returns an 712 error if an OPEN OUTPUT operation is started on a non-empty file. If this value is omitted, N is assumed by default

D|U

this parameter must only be specified in case of Define Alternate index path:

   D Duplicate key

   U Unique key

 

During the creation of a cluster or an alternate index path, you can inform xvsamCreate to produce a logging file containing the results of operations.

To do it, you should provide the -d<name> optional parameter. If this parameter is present, the utility creates a logging file with the name specified in <name>. If only -d is given, the logging file will be created in the same directory where xvsamCreate has been started, with the default name xvsamCreate.log.

The level of detail with which XVSAM should report the sequence of operations on the protocol file, may be specified by means of the -l<level> optional parameter.

For example, let us create a KSDS file named mycluster, belonging to the TESTCAT catalog and having fixed length records. The record size - minimum and maximum record length - is 38 bytes and the primary record key is 10 bytes long and starts from the beginning of the record. The syntax of the command for creating the file is the following:

# xvsamCreate
C TESTCAT MYCLUSTER TESTCAT K F 38 38 1 0 10 mycluster Y
<CTRL-D>
#

It is also possible to create more than one cluster at the same time as shown in the following script. In this example we intend to create one KSDS cluster - VSAMFILE - reusable, with variable length records and the path entries relative to two alternate indices.

We want also the run of the procedure to be logged in a protocol file named mydebug.log.

#!/bin/ksh
xvsamCreate -dmydebug.log <<EOT
C TESTCAT VSAMFILE TESTCAT K V 50 100 1 0 10 vsamfile Y
A TESTCAT ALTIND1 VSAMFILE D 1 5 10
A TESTCAT ALTIND2 VSAMFILE U 1 20 10
EOT

Return codes

0

Function correctly executed

12

error(s) trapped