You are on page 1of 37

VSAM DAY 3

Course schedule

UNIT VSAM Continued…..

Topics:

 Parameters of IDCAMS

 Alternate Index

 Path creation

 Export & Import

 Catalogs
Parameters of IDCAMS

Other parameters

REUSE
 Specifies that the cluster can be loaded with the fresh
records with an explicit delete of existing records.

DELETE
 Delete command is used to remove the entries from the
VSAM Catalog.

 DELETE HCL26.RRDS.CLUSTER
Parameters of IDCAMS

ALTER
 Used to rename the cluster name.
 Used to change the free space parameter.
 Used to add the volumes and remove
the volumes which is added to the cluster.
Parameters of IDCAMS

ALTER HCL26.KSDS.CLUSTER –

NEWNAME(HCL26.KSDS1.CLUSTER)
ALTER HCL26.KSDS1.CLUSTER
FREESPACE(25,25)
ALTER HCL26.KSDS1.CLUSTER
ADD VOLUMES(HCL001,HCL002)
Parameters of IDCAMS

PRINT

Print command is used to print the contents of both


VSAM and non-VSAM data sets.

PRINT INDATA SET (HCL26.RRDS.CLUSTER)


CHAR
Parameters of IDCAMS

REPLICATE
Direct the VSAM to duplicate each index as may
times as it will fit on it assigned track to reduce the
rotational delay and to make IO operations faster.
IMBED
Direct the VSAM to place the sequence set the
lowest level of the index next to the data
component on the first track of the control area
and duplicate as may times as it fit.
Parameters of IDCAMS

LISTCAT
The entries in VSAM dataset which is in catalog
will be listed.

VERIFY
Used to rectify the problems due to data corruption
should be used against cluster name only.
verify dataset(HCL26.RRDS.CLUSTER)
Parameters of IDCAMS

Deleting Records from a KSDS

Unlike in an ESDS, records in a KSDS can be

physically deleted.

To delete a record, the processing program has to

specify its key. VSAM uses this key to locate the


Parameters of IDCAMS

Corresponding control interval and deletes the

record.

If a record with the specified key does not exist in

the data set, VSAM will signal a record-not-found

condition.
Parameters of IDCAMS
Updating Records in a KSDS

A processing program can update a record by:


Reading it
Modifying its contents
Rewriting it

One restriction when updating a KSDS is that the


key field of a record cannot be altered.

Continued…
Alternate index

Alternate index can be created for KSDS and


ESDS.

The alternate index composed of the primary key


of the record along with the secondary key.

Max 253 alternate indexes can be create for a


base cluster.

VSAM data set can have only one unique key and
multiple alternate indexes.
Alternate index
Alternate index
The following items must be specified to the
operating system.

The name of the alternate index .


Define AIX

Name of the base cluster.


Relate(Base Cluster)

Key Size and the starting location in base cluster.


Keys(n1,n2)
Alternate index

The size of the record.


Recordsize(n1,n2)

Space allocated to it.


Tracks(3,3)

Alternate index key is unique key or not.


Uniquekey (or) Nonuniquekey

Freespace allocated to control intervals.


Freespace(10,10)
Alternate index

UPGRADE

The records in AIX are to be updated


automatically whenever the base cluster is
updated.
Alternate index
Building and Index

Used to populate the date from the base cluster to


AIX

SYNTAX:
BLDINDEX INFILE(BASECLUTERDDNAME),

OUTFILE(AIXCLUSTERNAME)
Path Creation

Path is used to establish a bridge between the


base cluster and alternate index.

Path is a VSAM object though it doesn’t contain

any records

- Same command for KSDS & ESDS

- Path is used to link JCL DSN to VSAM AIX


(specifies that the given AIX is to be used).
Path Creation
Specifying the Alternate Index Path

Example :

DEFINE PATH

(NAME(XIND.NLT.VSAM.DEPT.PATH)-

PATHENTRY -

(XIND.NLT.VSAM.DEPT.AIX) UPDATE)-
Path Creation

NAME

Syntax : NAME (pathname)

Pathname becomes the DSN in the run JCL


Path Creation
PATHENTRY

Syntax : PATHENTRY (entry


name/password)

Entryname : name assigned to alternate


index cluster

Required for an alternate index


Path - AIX - Base Cluster relation

Run JCL
Specifies Path Name

Path
Points to Alternate Index
Alternate Index
AIX is related to a Base Cluster
Base Cluster

Use path name in JCLs for alternate indexes


EXPORT/IMPORT

Used for backup and recovery


Catalog information also is exported along with the
data, unlike REPRO
DFSMS classes are preserved
Cluster deletion and redefinition are not necessary
during the import
Can be easily ported to other systems
EXPORT/IMPORT

Disadvantages

The EXPORTED file not reusable until it is


imported

Slower than REPRO


EXPORT/IMPORT

EXPORT

NAME - Name of vsam file


OUTFILE(DD1)
PERMANENT/TEMPORARY
INHIBITSOURCE/NOINHIBITSOURCE
INHIBITTARGET/NOINHIBITTARGET
EXPORT/IMPORT
//SAMP003B JOB ,,CLASS=A,
// MSGLEVEL=(1,1),NOTIFY=SAMP003,TIME=(1)
//EXPORT EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=SAMP003.BACK1.PS,DISP=(NEW,CATLG,KEEP),
// UNIT=SYSDA,DCB=(BLKSIZE=8000),
// SPACE=(TRK,(3,3))
//SYSIN DD *
EXPORT –
SAMP003.KSDS2.CLUSTER -
OUTFILE(DD1) -
PERMANENT -
INHIBITSOURCE -
INHIBITTARGET
/*
//
//STEP2 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=SAMP003.BACK1.PS,DISP=SHR
//SYSIN DD *
IMPORT -
INFILE(DD1)-
OUTDATASET(SAMP003.KSDS2.CLUSTER)
/*
//
Catalogs
Organizing Data Sets with
Catalogs

What is a catalog? Volume


ABC123
DATA SET.A
A catalog is simply a data set
which contains entries that
identify data sets and indicate Catalog
where those data sets reside.
When a data set is cataloged, unit and volume
information for the data set is stored in the catalog.

While cataloging a data set, the unit and volume


information should be omitted from the job control
language (JCL) Data Definition (DD) statement,
used to identify the data set.

The operating system locates the data set by


examining the data set’s entry in the catalog.
Catalogs

This has the following DATA SET.A Type = 3390


Volume = ABC123

advantages: Volume
ABC123
DATA SET.A

It reduces the chance of a


coding error.
Catalog

It makes it easier to move


JCL
data sets from one volume APPL
1

to another.
JCL O/S
APPL
2
Catalogs

Master Catalog
An Multiple Virtual Storage Operating System
(MVS) system has only one
master catalog. Master Catalog

Master catalog is used to


locate most system data sets
and all user catalogs.
User Catalogs

The location of the master


catalog is kept by the
operating system.
Catalogs

User Catalog
Operating System

It then searches this Master Catalog

catalog to locate the


data set.
User data sets are User Catalogs

normally cataloged in a
user catalog.
User Data sets

Concepts
Catalogs

The master catalog is used to locate the user


catalog. Each user catalog is listed in the master
catalog.
There can be any number of user catalogs in a
system.
When access to a data set is requested, the
operating system searches the master catalog to
locate the proper user catalog.
Catalogs

Itthen searches this catalog to


locate the data set.
places
entries in
There can be any number of
user catalogs in a system. Master Catalog
IDCAMS
When access to a data set is
requested, the operating system creates
searches the master catalog to
locate the proper user catalog.
User Catalog

Continued…
Catalogs

IDCAMS also creates an entry for the user catalog


in the master catalog.

Because this operation alters the master catalog, it


is normally performed by a storage administrator.

Entries are created in a user catalog when a


VSAM object is defined.
Catalogs

User catalogs are often


protected, mainly for the
following reasons:
P
To prevent unauthorized A
users from obtaining data set S
Master Catalog
S
information USERS
W
O
Accidentally cataloging data R
sets in the wrong catalog D

User Catalog
Catalogs

How is it protected?

A catalog can be protected using a security


package.
Otherwise, passwords can be assigned to allow
different levels of access to a catalog.

You might also like