vsam presentation ppt
DESCRIPTION
TRANSCRIPT
![Page 1: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/1.jpg)
VSAM
Overview
![Page 2: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/2.jpg)
VSAM (Virtual Storage Access Method )
VSAM is an integral part of MVS. At the end of this course, you, the user, will know VSAM in detail.
know the different types of VSAM data sets
be able to create, delete and alter VSAM data sets, with indexes and alternate indexes
know the organization of VSAM data sets
![Page 3: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/3.jpg)
Access Methods
An access method defines the technique by which data is stored and retrieved. The different types of dataset organizations in MVS are:
Physical Sequential
Partitioned
Indexed Sequential
Direct
VSAM
![Page 4: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/4.jpg)
What is VSAM?
VSAM is Virtual Storage Access Method
It is a method used to move data between Disk and Main Storage
VSAM operates in Virtual Environment
![Page 5: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/5.jpg)
Application Operating System
VSAM
Request Reply
VSAM
VSAM acts as interface between
Operating System and Application Program
![Page 6: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/6.jpg)
Main Storage Disk
VSAM
DATA DATA
VSAM
Interface between Main Storage and Disk
![Page 7: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/7.jpg)
File access methods
Data (Records) is retrieved
Sequential (Reading from beginning to end)
Random (Records are read by the value in the key)
Direct (Records are read based on their physical location/address on disk)
VSAM provides all these methods
One access method supporting all types of data retrieval
![Page 8: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/8.jpg)
Traditional access methods
QSAM (Queried Sequential Access Method)
BSAM (Basic Sequential Access Method)
for ‘flat’ files
ISAM (Index Sequential Access Method)
for Index files
BDAM (Basic Direct Access Method)
for direct access files
![Page 9: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/9.jpg)
VSAM Dataset Types
Entry Sequenced Dataset (ESDS)
ESDS contains records in the order in which they are entered. Records are added to the end of the data set, and can be accessed sequentially.
Key Sequenced Dataset (KSDS)
KSDS contains records in ascending collating sequence. Records can be accessed by a field called a key, or by a relative byte address (RBA - relative position of the record from the beginning of the dataset), or sequentially.
Linear Dataset (LDS)
LDS contains data that has no record boundaries. The manipulation of the data is completely controlled by the user.
Relative Record Dataset (RRDS)
RRDS contains records in the order of relative record number. These records can be accessed only by this number.
![Page 10: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/10.jpg)
CLUSTERINDEX
DATA
VSAM data set organization
VSAM Data Set can contain three major components
CLUSTER (Catalog entry)
INDEX
DATA (Actual data)
Data Set is referred by cluster name in JCL
![Page 11: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/11.jpg)
CI
Record Record .......
VSAM internals
CONTROL INTERVAL (CI)
VSAM stores Data and Index in Control Intervals (CI)
CI is similar to ‘Block’
![Page 12: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/12.jpg)
DASD I/O Buffer
R1 R2 R3
CI
CONTROL INTERVAL
CI is the unit of retrieval between DASD and I/O Buffer (Virtual Storage)
R1 R2 R3
![Page 13: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/13.jpg)
Control Interval
CI contains
Records (or DATA)
Free space (Optional)
Control Information Definition Field (CIDF)
Record Definition field (RDF)
![Page 14: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/14.jpg)
Building blocks of a VSAM Dataset
Logical Record
Logical records of VSAM data sets are stored in a different manner from logical records in non-VSAM data sets. VSAM stores records in control intervals.
Control Interval (CI)
A control interval consists of the following:
Logical records (LR)
Free space (FS)
Control information fields
LR LR LR LR..FS....FS...RDF CIDF
Free Space is the space reserved within the CI for inserting new records in a KSDS or for lengthening the existing records.
![Page 15: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/15.jpg)
3 bytes, Length of RecordHow many successive records have same length 4 bytes long, One per CI
Indicates Free space, where and how much
R1 R2 R3 FreeSpace
RDF
RDF
CI DF
CONTROL INTERVAL
CIDF & RDF are VSAM control functions
Used by VSAM to access data
![Page 16: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/16.jpg)
CONTROL AREA
Control Area
CIs are grouped into CA
The control intervals in a VSAM data set are grouped together into Control Areas.
A VSAM data set is actually composed of one or more control areas. The maximum size of a control area is a cylinder, and the minimum size is one track.
Control Area (CA)
LR LR LR LR.. FS....FS... RDF CIDFLR LR LR LR.. FS....FS... RDF CIDFLR LR LR LR.. FS....FS... RDF CIDF
![Page 17: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/17.jpg)
Cluster
VSAM datasets are defined as Clusters.
A Cluster is a combination of the data component and the index component.
The Index component is applicable only in the case of a KSDS.
The data component holds data records.
The index component holds the index records to access the required information from the data component
Highest Index Set
1300 1305 1310 1350 FS
1400 1410 1415 1600 FS
FS FS FS FS FS1001 1002 1005 1010 FS
1020 1022 1030 1055 FS
FS FS FS FS FS
1055
1600 FS 5000 FS FS
1010 1055 FS 1350 1600 FS
2210
5000
Index Set
Sequence Set
DATA COMPONENT (CA1)
Data Component (CA2)
![Page 18: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/18.jpg)
Control Interval Split
When a data set is first loaded, the key sequence of records and their physical order are the same.
However, when records are inserted, control interval split can occur, causing the data control intervals to have a physical order that is different from the key sequence.
For example, try to insert '1004' in CI-1 shown below :
A Control Interval Split occurs and CI-1 is split exactly into two half CI's. CI-3, which is a free control interval is used, and some logical records of CI-1 are moved into CI-3. CI-3 is placed after CI-2 and it is not inserted in between CI-1 and CI-2.
1001 1002 1005 1010 FS
1020 1022 1030 1055 FS
FS FS FS FS
CA-1 (CI-1 to CI-3) - After split
1001 1002 1004 FS
1020 1022 1030 1055 FS
1005 1010 FS FS
CA-1 (CI-1 to CI-3) - Before split
![Page 19: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/19.jpg)
Control Area Split
Now, if record ‘1025’ is inserted, there is no free control interval for a CI split to occur. Hence, a CA (control area) split occurs. The CA-1 is split into two half control areas; some of the Control intervals of CA-1 are moved into the newly created CA (CA-2).
CA-1 (CI-1 to CI-3) - After split
1001 1002 1004 FS
1020 1022 FS FS FS
FS FS FS FS
CA-2 (CI-1 to CI-3)
1025 1030 1055 FS
1005 1010 FS FS
FS FS FS FS
![Page 20: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/20.jpg)
Types of VSAM data sets
ESDS Entry Sequenced Data Set
KSDS Key Sequenced Data Set
RRDS Relative Record Data Set
LDS Linear Data Set
![Page 21: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/21.jpg)
ORGANIZATION
SEQUENTIAL => ESDSINDEXED => KSDSRELATIVE => RRDS
ACCESS MODE OPTIONS
ESDS : SEQUENTIAL KSDS : SEQUENTIAL or RANDOM or DYNAMICRRDS: SEQUENTIAL or RANDOM or DYNAMIC
![Page 22: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/22.jpg)
Access Method Services (AMS)
Access Method Services is a service program that helps you to allocate and maintain VSAM data sets and catalogs.
IDCAMS is the name of the utility program used to perform the following operations on VSAM data sets.
Creating a Data set
Loading a VSAM data set.
Printing a Data set
Deleting a Data set
Error Detection for KSDS Data set
Creating Generation Data Groups (GDG) etc.
![Page 23: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/23.jpg)
INVOKING ACCESS METHOD
IDCAMS UTLITY
![Page 24: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/24.jpg)
Defining a VSAM Cluster
The Define Cluster command is used to allocate VSAM data sets. The basic information required for defining a VSAM data set is:
Name of the cluster.
Volume(s) on which the data set will be allocated.
Type of data set (KSDS, ESDS, RRDS or LDS).
Space needed for the data set.
For a KSDS, the length of the key and its offset from the beginning of the record.
Record size, and whether it is fixed or variable in length.
Control interval size.
CI and CA Free Space.
The following keywords have to be used to define the different types of VSAM data sets:
NONINDEXED for ESDS.
INDEXED for KSDS.
NUMBERED for RRDS.
LINEAR for LDS.
![Page 25: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/25.jpg)
Sample JCL to create an ESDS cluster
Freespace(PCT1,PCT2)
PCT1=> PCT FREE SPACE IN each CI
PCT2=> PCT Of unused CI in CA
RECORDSIZE(N1,N2)
N1=> AVG RECL
N2=> MAX RECL
//LEM0UXXA JOB MSGCLASS=Q,CLASS=Q,NOTIFY=&SYSUID
//DEFKSDS EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER(NAME(LEM0UXX.TEST.ESDS) -
VOLUMES(LEM001) -
NONINDEXED -
TRACKS(2,1) -
RECORDSIZE(50,50) -
CONTROLINTERVALSIZE(4096) -
FREESPACE(10,20)) -
DATA(NAME(LEM0UXX.TEST.ESDS.DATA))
/*
NONINDEXED - ESDS
![Page 26: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/26.jpg)
COBOL AND ESDS
OVERVIEW
![Page 27: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/27.jpg)
ESDS
Similar to Sequential File
Sequenced by the order in which data is entered/loaded
New Records are added at the end only (chronological order)
Supports both Fixed and Variable formats
Contains only CLUSTER & DATA components
![Page 28: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/28.jpg)
Only sequential access in Batch Cobol Programs
Random access is supported in on-line applications (CICS) using Relative Byte Address (RBA)
Alternate Index is supported in on-line applications (CICS)
NO primary index
ESDS (Contd...)
![Page 29: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/29.jpg)
CI
RBA of R1 is 80
RBA
Record location relative to the beginning of the file(Relative Byte Address)
R1 R2 R380 40 60
![Page 30: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/30.jpg)
FILE-CONTROL Paragraph
Format:
SELECT [OPTIONAL] File-name-1 ASSIGN TO AS-Assignment-name-1
SEQUENTIAL
[ ORGANIZATION IS INDEXED
RELATIVE
SEQUENTIAL
[ACCESS MODE IS RANDOM
DYNAMIC
[FILE STATUS IS Data-name-1]
![Page 31: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/31.jpg)
ESDS
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL
INPUT OUTPUT INPUT-OUTPUT
EXTEND
READ YES - YES -
WRITE - YES YES
DELETE
REWRITE YES
![Page 32: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/32.jpg)
VSAM === ESDS
ORGANIZATION IS SEQUENTIAL.ACCESS MODE = SEQUENTIAL
OVERVIEW
![Page 33: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/33.jpg)
CREATING ESDS
![Page 34: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/34.jpg)
Writing Data in ESDS
![Page 35: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/35.jpg)
Writing Data in ESDS
![Page 36: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/36.jpg)
Writing Data in ESDS
![Page 37: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/37.jpg)
RUNNING A PROGRAM
![Page 38: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/38.jpg)
View the data from ESDS
REPRO COMMAND
![Page 39: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/39.jpg)
PRINT ESDS EXAMPLE
Overview
![Page 40: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/40.jpg)
PRINT ESDS
![Page 41: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/41.jpg)
PRINT ESDS
![Page 42: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/42.jpg)
PRINT ESDS
![Page 43: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/43.jpg)
KSDS (KEY SEQUENTIAL DATA SET )
![Page 44: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/44.jpg)
Sample JCL to create a KSDS cluster
//LEM0UXXA JOB MSGCLASS=Q,CLASS=Q,NOTIFY=&SYSUID
//DEFKSDS EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER(NAME(LEM0UXX.TEST.KSDS) -
VOLUMES(LEM001) -
TRACKS(2,1) -
INDEXED -
KEYS(9,0) -
RECORDSIZE(50,50) -
CONTROLINTERVALSIZE(4096) -
FREESPACE(10,20)) -
DATA(NAME(LEM0UXX.TEST.KSDS.DATA)) -
INDEX((NAME(LEM0UXX.TEST.KSDS.INDEX))
/*
KEYS(N1,N2)
N1=> length of the Key(Bytes)
N2=> is starting byte position
of Key in Record
RECORDSIZE(N1,N2)
N1=> AVG RECL
N2=> MAX RECL
Freespace(PCT1,PCT2)
PCT1=> PCT FREE SPACE IN each CI
PCT2=> PCT Of unused CI in CA
INDEXED - KSDS
![Page 45: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/45.jpg)
SELECT & ASSIGN Syntax
us FileStatIS STATUS FILE
DUPLICATESWITH AltKey IS KEY RECORDALTERNATE
cKey UniqueReIS KEYRECORD
SEQUENTIAL
IS MODEACCESS
INDEXED IS ONORGANIZATI
FileSpecTO ASSIGN
FileName]OPTIONAL[ SELECT
.CONTROL-FILE
.SECTION OUTPUT-INPUT
.DIVISION
DYNAMIC
RANDOM
TENVIRONMEN
![Page 46: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/46.jpg)
READ statement
READ
END READ
READ
END READ
FileName RECORD INTO DestItem
KEY IS KeyName
INVALID KEY StatementBlock
FileName NEXT RECORD INTO DestItem
AT END StatementBlock
![Page 47: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/47.jpg)
WRITE & REWRITE statement
WRITE
END WRITE
RecName FROM SourceItem
INVALID KEY StatementBlock
REWRITE
END REWRITE
RecName FROM SourceItem
INVALID KEY StatementBlock
![Page 48: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/48.jpg)
KSDS
ORGANIZATION IS INDEXED
ACCESS MODE IS SEQUENTIAL
INPUT OUTPUT INPUT-OUTPUT
READ YES - YES
WRITE - YES
DELETE YES
REWRITE YES
START YES YES
![Page 49: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/49.jpg)
INDEX FILE
ORGANIZATION IS INDEXED.ACCESS MODE = SEQUENTIAL
OVERVIEW
![Page 50: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/50.jpg)
CREATING KSDS
![Page 51: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/51.jpg)
WRITING A KSDS
![Page 52: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/52.jpg)
WRITING A KSDS
![Page 53: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/53.jpg)
WRITING KSDS
![Page 54: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/54.jpg)
RUNNING A KSDS
![Page 55: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/55.jpg)
Running a KSDS
![Page 56: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/56.jpg)
READING INDEX FILE-KSDS
ORGANIZATION IS INDEXED.ACCESS MODE = SEQUENTIAL
OVERVIEW
![Page 57: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/57.jpg)
READING A KSDS
![Page 58: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/58.jpg)
READING A KSDS FILE
![Page 59: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/59.jpg)
EXECUTE A PROGRAM FOR READING DATA FROM KSDS
![Page 60: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/60.jpg)
SPOOL OUTPUT
![Page 61: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/61.jpg)
SPOOL OUTPUT
![Page 62: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/62.jpg)
START & DELETE statement
DELETE
END DELETE
FileName RECORD
INVALID KEY StatementBlock
START
END START
FileName KEY
IS EQUAL TO
IS =
IS GREATER THAN
IS >
IS NOT LESS THAN
IS NOT <
KeyName
INVALID KEY StatementBlock
![Page 63: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/63.jpg)
START :Position a Record
![Page 64: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/64.jpg)
START COMMAND
![Page 65: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/65.jpg)
START COMMAND
![Page 66: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/66.jpg)
DELETE COMMAND
![Page 67: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/67.jpg)
DELETE COMMAND
![Page 68: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/68.jpg)
EXECUTE A PROGRAM AFTER COMPILE
![Page 69: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/69.jpg)
PRINT THE KSDS DATASET
![Page 70: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/70.jpg)
PRINT THE KSDS
![Page 71: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/71.jpg)
KSDS ORGANIZATION IS INDEXEDACCESS MODE IS RANDOM
![Page 72: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/72.jpg)
KSDS
ORGANIZATION IS INDEXED
ACCESS MODE IS RANDOM
INPUT OUTPUT INPUT-OUTPUT
READ YES - YES
WRITE - YES YES
DELETE YES
REWRITE YES
START
![Page 73: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/73.jpg)
KSDS – RANDOM- WRITE
![Page 74: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/74.jpg)
KSDS – Random -WRITE
![Page 75: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/75.jpg)
KSDS –RANDOM MODEREAD Operation
Overview
![Page 76: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/76.jpg)
KSDS – RANDOM -READ
![Page 77: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/77.jpg)
KSDS – RANDOM -READ
![Page 78: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/78.jpg)
KSDS ORGANIZATION IS INDEXEDACCESS MODE IS DYNAMIC
![Page 79: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/79.jpg)
KSDS
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
INPUT OUTPUT INPUT-OUTPUT
READ YES - YES
WRITE - YES YES
DELETE YES
REWRITE YES
START YES YES
![Page 80: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/80.jpg)
KSDS- DYNAMIC MODE WRITE OPERATION
Overview
![Page 81: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/81.jpg)
KSDS –DYNAMIC- WRITE
![Page 82: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/82.jpg)
KSDS –DYNAMIC-WRITE
![Page 83: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/83.jpg)
KSDS –DYNAMIC-READ
![Page 84: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/84.jpg)
KSDS-DYNAMIC-READ
![Page 85: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/85.jpg)
RRDS
Overview
![Page 86: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/86.jpg)
Sample JCL to create an RRDS cluster
//LEM0UXXA JOB MSGCLASS=Q,CLASS=Q,NOTIFY=&SYSUID
//DEFRRDS EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER(NAME(LEM0UXX.TEST.RRDS) -
VOLUMES(LEM001) -
NUMBERED -
TRACKS(2,1) -
RECORDSIZE(50,50) -
CONTROLINTERVALSIZE(4096) -
FREESPACE(10,20)) -
DATA(NAME(LEM0UXX.TEST.RRDS.DATA))
/*
RECORDSIZE(N1,N2)
N1=> AVG RECL
N2=> MAX RECL
Freespace(PCT1,PCT2)
PCT1=> PCT FREE SPACE IN each CI
PCT2=> PCT Of unused CI in CA
NUMBERED - RRDS
![Page 87: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/87.jpg)
RELATIVE-RANDOM-WRITE
![Page 88: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/88.jpg)
RELATIVE-RANDOM-WRITE
![Page 89: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/89.jpg)
RELATIVE-RANDOM-READ
![Page 90: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/90.jpg)
RELATIVE-RANDOM-READ
![Page 91: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/91.jpg)
RANDOM READ JCL
![Page 92: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/92.jpg)
SPOOL OUTPUT
![Page 93: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/93.jpg)
RELATIVE-DYNAMIC-READ
![Page 94: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/94.jpg)
RELATIVE-DYNAMIC-READ
![Page 95: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/95.jpg)
RELATIVE-DYNAMIC-READ
![Page 96: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/96.jpg)
ALTERNATE INDEX
Overview
![Page 97: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/97.jpg)
ALTERNATE INDEXES
Used whenever the data is required to be retrieved on the basis of more than one field
EMPNO ENAME SALARY
101 RAJESH 5000
102 RAMESH 6000
103 RANDY 7000
104 SURESH 8000
e.g., Can be defined for both KSDS & ESDS
EMPNO ISBASE KEY
ENAME ISALTERNATE KEY
![Page 98: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/98.jpg)
Reduce data redundancy Can have duplicates Easy to define using IDCAMS Allow datasets to be accessed sequentially or
randomly Can be updated automatically
ALTERNATE INDEXES
![Page 99: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/99.jpg)
Disadvantages
Performance degradation
Complex update logic
![Page 100: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/100.jpg)
Steps for Creating Alternate Index
Define AIX using IDCAMS DEFINE AIX
Specify Alternate Index Path using IDCAMS DEFINE PATH
Build AIX & populate it using IDCAMS BLDINDEX
![Page 101: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/101.jpg)
Sample JCL to create an AIX cluster
Freespace(PCT1,PCT2)
PCT1=> PCT FREE SPACE IN each CI
PCT2=> PCT Of unused CI in CA
RECORDSIZE(N1,N2)
N1=> AVG RECL
N2=> MAX RECL
//LEM0UXXA JOB MSGCLASS=Q,CLASS=Q,NOTIFY=&SYSUID
//DEFKSDS EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE AIX (NAME(LEM0UXX.TEST.AIX.CLUSTER) –
RELATE (LEM0UXX.INFILE.KSDS) -
VOLUMES(LEM001) -
KEY (10, 35) -
TRACKS(2,1) -
NONUNIQUEKEY -
RECORDSIZE(49,49) -
UPGRADE
CONTROLINTERVALSIZE(4096) -
FREESPACE(10,20)) -
DATA(NAME(LEM0UXX.TEST.AIX.DATA))
INDEX(NAME(LEM0UXX.TEST.AIX.INDEX))
/*
UNIQUE /NONUNIQUE
UPGRADE-> VSAM AUTOMATIC
Updates the AIX for all
ADD,UPDT,DEL of Base cluster
KEY ( N1,N2)
N1-> LENGTH OF AIX key
N2-> KEYS start Loc in BASE CLUSTER
![Page 102: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/102.jpg)
• Syntax : UPGRADE/NOUPGRADE
• UPGRADE specifies that records in AIX are to be updated• automatically whenever the base cluster is updated
UPGRADE/NOUPGRADEUPGRADE/NOUPGRADE
![Page 103: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/103.jpg)
BUILDING AN INDEX
Overview
![Page 104: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/104.jpg)
BUILD INDEX
//JOB CARD
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
BLDINDEX -
INDATASET(LEM0UXX.KSDS.CLUSTER') -
OUTDATASET('LEM0UXX.KSDS.AIX.CLUSTER') -
/*
BUILD INDEX is used
To load records in
AIX after it has been def
![Page 105: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/105.jpg)
PATH AND ALTERNATE INDEX
Overview
![Page 106: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/106.jpg)
DEFINE PATH
//JOB CARD
//STEP1 EXEC PGM = IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE PATH -
( NAME ( LEM0UXX.KSDS.PATH) –
PATHENTRY(LEM0UXX.KSDS.AIX.CLUSTER) –
UPDATE )
/*
//
Path Establishes
A Bridge Between
BASE CLUSTER & AIX
![Page 107: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/107.jpg)
ALTERNATE Index Example
![Page 108: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/108.jpg)
Define BASE CLUSTER
![Page 109: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/109.jpg)
LOADING DATA INTO BASE CLUSTER
![Page 110: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/110.jpg)
LOADING DATA INTO BASE CLUSTER
![Page 111: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/111.jpg)
LOADING DATA INTO BASE CLUSTER
![Page 112: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/112.jpg)
EXECUTING A PROGRAM TO LOAD DATA
![Page 113: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/113.jpg)
EXECUTING A PROGRAM TO LOAD DATA
![Page 114: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/114.jpg)
DEFINING AIX
RECORDSIZE(N1,N2)
N1= LENGTH OF BASE CLUSTER KEY(3)
+ LENGTH OF AIX KEY(5) + 5 for CI
![Page 115: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/115.jpg)
Build index
![Page 116: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/116.jpg)
Create path for Bridge
![Page 117: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/117.jpg)
READING RECORDS BY ALTERNATE INDEX
![Page 118: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/118.jpg)
READING RECORD BY ALTERNATE KEY
![Page 119: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/119.jpg)
READING RECORD BY ALTERNATE KEY
![Page 120: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/120.jpg)
EXECUTE A READ PROGRAM BY ALTERNATE KEY
DD1-> BASE CLUSTER
DD11-> PATH NAME
DDNAME SHOULD BE IN ORDER
![Page 121: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/121.jpg)
SPOOL OUTPUT
![Page 122: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/122.jpg)
IDCAMS REPRO
![Page 123: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/123.jpg)
IDCAMS REPRO KEY BASED
![Page 124: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/124.jpg)
IDCAMS REPRO RELATIVE
![Page 125: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/125.jpg)
IDCAMS LISTCAT
![Page 126: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/126.jpg)
SPOOL OUTPUT
![Page 127: Vsam presentation PPT](https://reader033.vdocuments.site/reader033/viewer/2022061220/54ba7dc04a7959c2498b458c/html5/thumbnails/127.jpg)
IDCAMS DELETE