SlideShare una empresa de Scribd logo
1 de 127
Descargar para leer sin conexión
VSAM



Overview
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
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
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
VSAM

   VSAM acts as interface between
      Operating System and Application Program




                              V
               Request        S       Reply       Operating
Application
                              A                   System
                              M
VSAM

    Interface between Main Storage and Disk



                            V
                            S
Main Storage     DATA       A      DATA        Disk
                            M
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
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
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.
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




                                 INDEX
      CLUSTER
                                  DATA
VSAM internals

   CONTROL INTERVAL (CI)
   VSAM stores Data and Index in Control Intervals (CI)
   CI is similar to ‘Block’



                               CI



          Record                    Record       .......
CONTROL INTERVAL

   CI is the unit of retrieval between DASD and I/O Buffer (Virtual
    Storage)

         DASD                                        I/O Buffer

          CI


    R1     R2       R3                          R1      R2        R3
Control Interval

   CI contains
      Records (or DATA)
      Free space (Optional)
      Control Information Definition Field (CIDF)
      Record Definition field (RDF)
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.
CONTROL INTERVAL

    CIDF & RDF are VSAM control functions
    Used by VSAM to access data

                                      R           R             C
R1    R2               Free                       D             I
              R3                      D
                       Space                      F             D
                                      F
                                                                F

3 bytes, Length of Record
How many successive
records have same length                  4 bytes long, One per CI
                                          Indicates Free space,
                                          where and how much
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 CIDF
        LR LR LR LR.. FS....FS... RDF CIDF
        LR LR LR LR.. FS....FS... RDF CIDF
Cluster

         VSAM datasets are defined as             Highest Index Set
          Clusters.                               2210   5000

         A Cluster is a combination of the
          data component and the index             Index Set
          component.                              1055   1600    FS      5000        FS     FS

         The Index component is applicable
          only in the case of a KSDS.             Sequence Set
         The data component holds data           1010   1055     FS          1350        1600    FS
          records.
         The index component holds the
          index records to access the required   DATA COMPONENT (CA1)
          information from the data
          component                              1300     1305         1310          1350        FS
                                                 1400     1410         1415          1600        FS
Data Component (CA2)
                                                 FS       FS           FS            FS          FS
 1001 1002      1005   1010    FS
 1020 1022      1030   1055    FS
 FS       FS    FS     FS      FS
Control Interval Split

                                           CA-1 (CI-1 to CI-3) - Before split
   When a data set is first loaded,
    the key sequence of records and        1001    1002      1005    1010       FS
    their physical order are the same.
    However, when records are             1020    1022      1030    1055       FS
    inserted, control interval split can
    occur, causing the data control
    intervals to have a physical order     FS      FS        FS      FS
    that is different from the key
    sequence.
   For example, try to insert '1004'      CA-1 (CI-1 to CI-3) - After split
    in CI-1 shown below :
   A Control Interval Split occurs
                                           1001    1002      1004     FS
    and CI-1 is split exactly into two
    half CI's. CI-3, which is a free       1020    1022      1030     1055      FS
    control interval is used, and some
    logical records of CI-1 are moved
    into CI-3. CI-3 is placed after CI-    1005    1010      FS       FS
    2 and it is not inserted in between
    CI-1 and CI-2.
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
Types of VSAM data sets

   ESDS        Entry Sequenced Data Set
   KSDS        Key Sequenced Data Set
   RRDS        Relative Record Data Set
   LDS         Linear Data Set
ORGANIZATION

     SEQUENTIAL => ESDS
     INDEXED     => KSDS
     RELATIVE => RRDS

      ACCESS MODE OPTIONS

ESDS : SEQUENTIAL
KSDS : SEQUENTIAL or RANDOM or DYNAMIC
RRDS: SEQUENTIAL or RANDOM or DYNAMIC
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.
INVOKING ACCESS
METHOD



IDCAMS UTLITY
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.
Sample JCL to create an ESDS cluster


//LEM0UXXA JOB
   MSGCLASS=Q,CLASS=Q,NOTIFY=&SYSUID
//DEFKSDS EXEC PGM=IDCAMS                      NONINDEXED - ESDS
//SYSPRINT DD SYSOUT=*
//SYSIN   DD *
 DEFINE CLUSTER(NAME(LEM0UXX.TEST.ESDS) -
 VOLUMES(LEM001)             -
                                               RECORDSIZE(N1,N2)
 NONINDEXED              -
 TRACKS(2,1)         -                         N1=> AVG RECL
 RECORDSIZE(50,50)           -                 N2=> MAX RECL
 CONTROLINTERVALSIZE(4096)       -
 FREESPACE(10,20))           -
 DATA(NAME(LEM0UXX.TEST.ESDS.DATA))
/*

                                            Freespace(PCT1,PCT2)

                                            PCT1=> PCT FREE SPACE IN each CI

                                            PCT2=> PCT Of unused CI in CA
COBOL AND ESDS



OVERVIEW
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
ESDS (Contd...)

   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
RBA

   Record location relative to the beginning of the file
    (Relative Byte Address)

                                    CI


              R1                 R2                 R3
              80                 40                 60


                           RBA of R1 is 80
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]
ESDS

   ORGANIZATION IS SEQUENTIAL
   ACCESS MODE IS SEQUENTIAL


                        INPUT    OUTPUT   INPUT-   EXTEND
                                          OUTPUT
              READ      YES      -        YES      -

              WRITE     -        YES               YES

              DELETE

              REWRITE                     YES
VSAM === ESDS

ORGANIZATION IS SEQUENTIAL.
ACCESS MODE = SEQUENTIAL



 OVERVIEW
CREATING ESDS
Writing Data in ESDS
Writing Data in ESDS
Writing Data in ESDS
RUNNING A PROGRAM
View the data from ESDS



REPRO COMMAND
PRINT ESDS EXAMPLE



Overview
PRINT ESDS
PRINT ESDS
PRINT ESDS
KSDS (KEY SEQUENTIAL
DATA SET )
Sample JCL to create a KSDS cluster
                                                   KEYS(N1,N2)

//LEM0UXXA JOB MSGCLASS=Q,CLASS=Q,NOTIFY=&SYSUID   N1=> length of the Key(Bytes)

//DEFKSDS EXEC PGM=IDCAMS                          N2=> is starting byte position

//SYSPRINT DD SYSOUT=*                                 of Key in Record

//SYSIN   DD *

 DEFINE CLUSTER(NAME(LEM0UXX.TEST.KSDS)   -           RECORDSIZE(N1,N2)
 VOLUMES(LEM001)     -                                N1=> AVG RECL
 TRACKS(2,1)                 -
                                                      N2=> MAX RECL
 INDEXED                 -

 KEYS(9,0)               -
                                                       INDEXED - KSDS
 RECORDSIZE(50,50)               -

 CONTROLINTERVALSIZE(4096)           -
                                               Freespace(PCT1,PCT2)
 FREESPACE(10,20))               -
                                               PCT1=> PCT FREE SPACE IN each CI
 DATA(NAME(LEM0UXX.TEST.KSDS.DATA)) -
                                               PCT2=> PCT Of unused CI in CA
 INDEX((NAME(LEM0UXX.TEST.KSDS.INDEX))
SELECT & ASSIGN Syntax

ENVIRONMENT DIVISION.
INP UT- OUT P UTSECT ION.
FILE - CONT ROL.
      SELECT [OP T IONAL FileName
                       ]
          ASSIGN T O FileSpec
          ORGANIZAT I IS INDEXED
                      ON
                               SEQUENT IAL
          ACCESS MODE IS        RANDOM
                                DYNAMIC
          RECORD KEY IS UniqueRecKey
          ALT ERNAT ERECORD KEY IS AltKey WIT HDUP LICAT ES
          FILE ST AT US IS FileStatus
READ statement

READ FileName RECORD INTO DestItem
      KEY IS KeyName
      INVALID KEY StatementBlock
END   READ




READ FileName NEXT RECORD     INTO DestItem
      AT END StatementBlock
END   READ
WRITE & REWRITE statement


WRITE RecName FROM SourceItem
      INVALID KEY StatementBlock
END   WRITE


REWRITE RecName FROM SourceItem
      INVALID KEY StatementBlock
END   REWRITE
KSDS

   ORGANIZATION IS INDEXED
   ACCESS MODE IS SEQUENTIAL


                        INPUT   OUTPUT   INPUT-
                                         OUTPUT
              READ      YES     -        YES

              WRITE     -       YES

              DELETE                     YES

              REWRITE                    YES

              START     YES              YES
INDEX FILE

ORGANIZATION IS INDEXED.
ACCESS MODE = SEQUENTIAL



 OVERVIEW
CREATING KSDS
WRITING A KSDS
WRITING A KSDS
WRITING KSDS
RUNNING A KSDS
Running a KSDS
READING INDEX FILE-KSDS

ORGANIZATION IS INDEXED.
ACCESS MODE = SEQUENTIAL



 OVERVIEW
READING A KSDS
READING A KSDS FILE
EXECUTE A PROGRAM FOR READING DATA
FROM KSDS
SPOOL OUTPUT
SPOOL OUTPUT
START & DELETE statement


                       IS EQUAL TO
                       IS =
                       IS GREATER THAN
START FileName KEY                           KeyName
                       IS >
                       IS NOT LESS THAN
                       IS NOT <
                INVALID KEY StatementBlock
END START


DELETE FileName RECORD
    INVALID KEY StatementBlock
END DELETE
START :Position a Record
START COMMAND
START COMMAND
DELETE COMMAND
DELETE COMMAND
EXECUTE A PROGRAM AFTER COMPILE
PRINT THE KSDS DATASET
PRINT THE KSDS
KSDS
ORGANIZATION IS INDEXED
ACCESS MODE IS RANDOM
KSDS

   ORGANIZATION IS INDEXED
   ACCESS MODE IS RANDOM


                      INPUT   OUTPUT   INPUT-
                                       OUTPUT
            READ      YES     -        YES


            WRITE     -       YES      YES

            DELETE                     YES

            REWRITE                    YES

            START
KSDS – RANDOM- WRITE
KSDS – Random -WRITE
KSDS –RANDOM MODE
READ Operation



Overview
KSDS – RANDOM -READ
KSDS – RANDOM -READ
KSDS
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
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
KSDS- DYNAMIC MODE
WRITE OPERATION



Overview
KSDS –DYNAMIC- WRITE
KSDS –DYNAMIC-WRITE
KSDS –DYNAMIC-READ
KSDS-DYNAMIC-READ
RRDS



Overview
Sample JCL to create an RRDS cluster


//LEM0UXXA JOB
MSGCLASS=Q,CLASS=Q,NOTIFY=&SYSUID

//DEFRRDS EXEC PGM=IDCAMS                              NUMBERED - RRDS
//SYSPRINT DD SYSOUT=*

//SYSIN    DD *

     DEFINE CLUSTER(NAME(LEM0UXX.TEST.RRDS)   -
                                                           RECORDSIZE(N1,N2)
     VOLUMES(LEM001)                 -
                                                           N1=> AVG RECL
     NUMBERED                -
                                                           N2=> MAX RECL
     TRACKS(2,1)         -

     RECORDSIZE(50,50)           -

     CONTROLINTERVALSIZE(4096)           -
                                                  Freespace(PCT1,PCT2)
     FREESPACE(10,20))           -
                                                  PCT1=> PCT FREE SPACE IN each CI
     DATA(NAME(LEM0UXX.TEST.RRDS.DATA))
                                                  PCT2=> PCT Of unused CI in CA
/*
RELATIVE-RANDOM-WRITE
RELATIVE-RANDOM-WRITE
RELATIVE-RANDOM-READ
RELATIVE-RANDOM-READ
RANDOM READ JCL
SPOOL OUTPUT
RELATIVE-DYNAMIC-READ
RELATIVE-DYNAMIC-READ
RELATIVE-DYNAMIC-READ
ALTERNATE INDEX



Overview
ALTERNATE INDEXES


   Used whenever the data is required to be retrieved on the basis of m
    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 IS                          ENAME IS
BASE KEY                       ALTERNATE KEY
ALTERNATE INDEXES

Reduce   data redundancy
Can have duplicates
Easy to define using IDCAMS
Allow datasets to be accessed sequentially or
randomly
Can be updated automatically
Disadvantages

   Performance degradation
   Complex update logic
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
Sample JCL to create an AIX cluster
                                                    UPGRADE-> VSAM AUTOMATIC

                                                    Updates the AIX for all

                                                    ADD,UPDT,DEL of Base cluster
//LEM0UXXA JOB
    MSGCLASS=Q,CLASS=Q,NOTIFY=&SYSUID
//DEFKSDS EXEC PGM=IDCAMS
                                                        UNIQUE /NONUNIQUE
//SYSPRINT DD SYSOUT=*
//SYSIN   DD *
 DEFINE AIX (NAME(LEM0UXX.TEST.AIX.CLUSTER) –
                                                KEY ( N1,N2)
 RELATE (LEM0UXX.INFILE.KSDS)              -    N1-> LENGTH OF AIX key
 VOLUMES(LEM001)                 -
 KEY (10, 35)                    -              N2-> KEYS start Loc in BASE CLUSTER
TRACKS(2,1)          -
NONUNIQUEKEY             -                              RECORDSIZE(N1,N2)
RECORDSIZE(49,49)            -
                                                        N1=> AVG RECL
UPGRADE
CONTROLINTERVALSIZE(4096)            -                  N2=> MAX RECL
FREESPACE(10,20))            -
DATA(NAME(LEM0UXX.TEST.AIX.DATA))
INDEX(NAME(LEM0UXX.TEST.AIX.INDEX))                 Freespace(PCT1,PCT2)
/*
                                                    PCT1=> PCT FREE SPACE IN each CI

                                                    PCT2=> PCT Of unused CI in CA
UPGRADE/NOUPGRADE



• Syntax : UPGRADE/NOUPGRADE


• UPGRADE specifies that records
  in AIX are to be updated
• automatically whenever the
  base cluster is updated
BUILDING AN INDEX



Overview
BUILD INDEX

//JOB CARD
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
                                                   BUILD INDEX is used
//SYSIN DD *
                                                   To load records in
     BLDINDEX   -
     INDATASET(LEM0UXX.KSDS.CLUSTER') -         AIX after it has been def
     OUTDATASET('LEM0UXX.KSDS.AIX.CLUSTER') -
/*
PATH AND ALTERNATE
INDEX



Overview
DEFINE PATH

//JOB CARD
//STEP1 EXEC PGM = IDCAMS             Path Establishes
//SYSPRINT DD SYSOUT=*                A Bridge Between

//SYSIN      DD *                    BASE CLUSTER & AIX

     DEFINE PATH -
     ( NAME ( LEM0UXX.KSDS.PATH) –
     PATHENTRY(LEM0UXX.KSDS.AIX.CLUSTER) –
     UPDATE )
/*
//
ALTERNATE Index
Example
Define BASE CLUSTER
LOADING DATA INTO BASE CLUSTER
LOADING DATA INTO BASE CLUSTER
LOADING DATA INTO BASE CLUSTER
EXECUTING A PROGRAM TO LOAD DATA
EXECUTING A PROGRAM TO LOAD DATA
DEFINING AIX



                      RECORDSIZE(N1,N2)

               N1= LENGTH OF BASE CLUSTER KEY(3)

               + LENGTH OF AIX KEY(5) + 5 for CI
Build index
Create path for Bridge
READING RECORDS BY ALTERNATE INDEX
READING RECORD BY ALTERNATE KEY
READING RECORD BY ALTERNATE KEY
EXECUTE A READ PROGRAM BY ALTERNATE
KEY




                             DD1-> BASE CLUSTER

                              DD11-> PATH NAME

                          DDNAME SHOULD BE IN ORD
SPOOL OUTPUT
IDCAMS REPRO
IDCAMS REPRO KEY BASED
IDCAMS REPRO RELATIVE
IDCAMS LISTCAT
SPOOL OUTPUT
IDCAMS DELETE

Más contenido relacionado

La actualidad más candente

Datasets and catalogs
Datasets and catalogs Datasets and catalogs
Datasets and catalogs Roma Vyas
 
JCL MAINFRAMES
JCL MAINFRAMESJCL MAINFRAMES
JCL MAINFRAMESkamaljune
 
DB2 and storage management
DB2 and storage managementDB2 and storage management
DB2 and storage managementCraig Mullins
 
Job Control Language
Job Control LanguageJob Control Language
Job Control Languagekapa rohit
 
ALL ABOUT DB2 DSNZPARM
ALL ABOUT DB2 DSNZPARMALL ABOUT DB2 DSNZPARM
ALL ABOUT DB2 DSNZPARMIBM
 
Introduction of ISPF
Introduction of ISPFIntroduction of ISPF
Introduction of ISPFAnil Bharti
 
CICS basics overview session-1
CICS basics overview session-1CICS basics overview session-1
CICS basics overview session-1Srinimf-Slides
 
Basic IMS For Applications
Basic IMS For ApplicationsBasic IMS For Applications
Basic IMS For ApplicationsDan O'Dea
 
IBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration BasicsIBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration BasicsIBM
 
DB2 for z/OS and DASD-based Disaster Recovery - Blowing away the myths
DB2 for z/OS and DASD-based Disaster Recovery - Blowing away the mythsDB2 for z/OS and DASD-based Disaster Recovery - Blowing away the myths
DB2 for z/OS and DASD-based Disaster Recovery - Blowing away the mythsFlorence Dubois
 
Top jcl interview questions and answers job interview tips
Top jcl interview questions and answers job interview tipsTop jcl interview questions and answers job interview tips
Top jcl interview questions and answers job interview tipsjcltutorial
 
RACF - The Basics (v1.2)
RACF - The Basics (v1.2)RACF - The Basics (v1.2)
RACF - The Basics (v1.2)Rui Miguel Feio
 
Db2 and storage management (mullins)
Db2 and storage management (mullins)Db2 and storage management (mullins)
Db2 and storage management (mullins)Craig Mullins
 

La actualidad más candente (20)

VSAM Tuning
VSAM TuningVSAM Tuning
VSAM Tuning
 
Datasets and catalogs
Datasets and catalogs Datasets and catalogs
Datasets and catalogs
 
Jcl
JclJcl
Jcl
 
JCL MAINFRAMES
JCL MAINFRAMESJCL MAINFRAMES
JCL MAINFRAMES
 
DB2 and storage management
DB2 and storage managementDB2 and storage management
DB2 and storage management
 
Job Control Language
Job Control LanguageJob Control Language
Job Control Language
 
ALL ABOUT DB2 DSNZPARM
ALL ABOUT DB2 DSNZPARMALL ABOUT DB2 DSNZPARM
ALL ABOUT DB2 DSNZPARM
 
Skillwise JCL
Skillwise JCLSkillwise JCL
Skillwise JCL
 
Introduction of ISPF
Introduction of ISPFIntroduction of ISPF
Introduction of ISPF
 
CICS basics overview session-1
CICS basics overview session-1CICS basics overview session-1
CICS basics overview session-1
 
Basic IMS For Applications
Basic IMS For ApplicationsBasic IMS For Applications
Basic IMS For Applications
 
IBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration BasicsIBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration Basics
 
Tso and ispf
Tso and ispfTso and ispf
Tso and ispf
 
SKILLWISE-DB2 DBA
SKILLWISE-DB2 DBASKILLWISE-DB2 DBA
SKILLWISE-DB2 DBA
 
Mvs commands
Mvs commandsMvs commands
Mvs commands
 
DB2 for z/OS and DASD-based Disaster Recovery - Blowing away the myths
DB2 for z/OS and DASD-based Disaster Recovery - Blowing away the mythsDB2 for z/OS and DASD-based Disaster Recovery - Blowing away the myths
DB2 for z/OS and DASD-based Disaster Recovery - Blowing away the myths
 
Top jcl interview questions and answers job interview tips
Top jcl interview questions and answers job interview tipsTop jcl interview questions and answers job interview tips
Top jcl interview questions and answers job interview tips
 
Ipl process
Ipl processIpl process
Ipl process
 
RACF - The Basics (v1.2)
RACF - The Basics (v1.2)RACF - The Basics (v1.2)
RACF - The Basics (v1.2)
 
Db2 and storage management (mullins)
Db2 and storage management (mullins)Db2 and storage management (mullins)
Db2 and storage management (mullins)
 

Similar a Vsam presentation PPT

16119 - Get to Know Your Data Sets (1).pdf
16119 - Get to Know Your Data Sets (1).pdf16119 - Get to Know Your Data Sets (1).pdf
16119 - Get to Know Your Data Sets (1).pdf3operatordcslipiPeng
 
Vsam interview questions and answers.
Vsam interview questions and answers.Vsam interview questions and answers.
Vsam interview questions and answers.Sweta Singh
 
WAVV 2009 - Migration to CICS TS for VSE/ESA
WAVV 2009 - Migration to CICS TS for VSE/ESAWAVV 2009 - Migration to CICS TS for VSE/ESA
WAVV 2009 - Migration to CICS TS for VSE/ESAillustrosystems
 
Seismic Analysis Code (SAC)
Seismic Analysis Code (SAC)Seismic Analysis Code (SAC)
Seismic Analysis Code (SAC)ssuser8193e7
 
Parallel Sysplex Implement2
Parallel Sysplex Implement2Parallel Sysplex Implement2
Parallel Sysplex Implement2ggddggddggdd
 
SRV405 Ancestry's Journey to Amazon Redshift
SRV405 Ancestry's Journey to Amazon RedshiftSRV405 Ancestry's Journey to Amazon Redshift
SRV405 Ancestry's Journey to Amazon RedshiftAmazon Web Services
 
Reading the LISTCAT entries for VSAM
Reading the LISTCAT entries for VSAMReading the LISTCAT entries for VSAM
Reading the LISTCAT entries for VSAMDan O'Dea
 
Introduction to Storage.ppt
Introduction to Storage.pptIntroduction to Storage.ppt
Introduction to Storage.pptParam Eswaran
 
wireless lan presentation.ppt
wireless lan presentation.pptwireless lan presentation.ppt
wireless lan presentation.pptHODElex
 
AWS SSA Webinar 20 - Getting Started with Data Warehouses on AWS
AWS SSA Webinar 20 - Getting Started with Data Warehouses on AWSAWS SSA Webinar 20 - Getting Started with Data Warehouses on AWS
AWS SSA Webinar 20 - Getting Started with Data Warehouses on AWSCobus Bernard
 
Cics data access-session 4
Cics data access-session 4Cics data access-session 4
Cics data access-session 4Srinimf-Slides
 
Getting started with Amazon Redshift
Getting started with Amazon RedshiftGetting started with Amazon Redshift
Getting started with Amazon RedshiftAmazon Web Services
 
Demystifying the JESD204B High-speed Data Converter-to-FPGA interface
Demystifying the JESD204B High-speed Data Converter-to-FPGA interfaceDemystifying the JESD204B High-speed Data Converter-to-FPGA interface
Demystifying the JESD204B High-speed Data Converter-to-FPGA interfaceAnalog Devices, Inc.
 

Similar a Vsam presentation PPT (20)

16119 - Get to Know Your Data Sets (1).pdf
16119 - Get to Know Your Data Sets (1).pdf16119 - Get to Know Your Data Sets (1).pdf
16119 - Get to Know Your Data Sets (1).pdf
 
VSAM for ever, Alvaro Salla, CMG Brasil 2011
VSAM for ever, Alvaro Salla, CMG Brasil 2011VSAM for ever, Alvaro Salla, CMG Brasil 2011
VSAM for ever, Alvaro Salla, CMG Brasil 2011
 
Vsam interview questions and answers.
Vsam interview questions and answers.Vsam interview questions and answers.
Vsam interview questions and answers.
 
WAVV 2009 - Migration to CICS TS for VSE/ESA
WAVV 2009 - Migration to CICS TS for VSE/ESAWAVV 2009 - Migration to CICS TS for VSE/ESA
WAVV 2009 - Migration to CICS TS for VSE/ESA
 
Seismic Analysis Code (SAC)
Seismic Analysis Code (SAC)Seismic Analysis Code (SAC)
Seismic Analysis Code (SAC)
 
WLAN
WLANWLAN
WLAN
 
SAN Concepts
SAN ConceptsSAN Concepts
SAN Concepts
 
Parallel Sysplex Implement2
Parallel Sysplex Implement2Parallel Sysplex Implement2
Parallel Sysplex Implement2
 
SRV405 Ancestry's Journey to Amazon Redshift
SRV405 Ancestry's Journey to Amazon RedshiftSRV405 Ancestry's Journey to Amazon Redshift
SRV405 Ancestry's Journey to Amazon Redshift
 
Oracle acfs in oracle 11
Oracle acfs in oracle 11Oracle acfs in oracle 11
Oracle acfs in oracle 11
 
Reading the LISTCAT entries for VSAM
Reading the LISTCAT entries for VSAMReading the LISTCAT entries for VSAM
Reading the LISTCAT entries for VSAM
 
Introduction to Storage.ppt
Introduction to Storage.pptIntroduction to Storage.ppt
Introduction to Storage.ppt
 
wireless lan presentation.ppt
wireless lan presentation.pptwireless lan presentation.ppt
wireless lan presentation.ppt
 
Intro to IDMS
Intro to IDMSIntro to IDMS
Intro to IDMS
 
AWS SSA Webinar 20 - Getting Started with Data Warehouses on AWS
AWS SSA Webinar 20 - Getting Started with Data Warehouses on AWSAWS SSA Webinar 20 - Getting Started with Data Warehouses on AWS
AWS SSA Webinar 20 - Getting Started with Data Warehouses on AWS
 
Cics data access-session 4
Cics data access-session 4Cics data access-session 4
Cics data access-session 4
 
Getting started with Amazon Redshift
Getting started with Amazon RedshiftGetting started with Amazon Redshift
Getting started with Amazon Redshift
 
Demystifying the JESD204B High-speed Data Converter-to-FPGA interface
Demystifying the JESD204B High-speed Data Converter-to-FPGA interfaceDemystifying the JESD204B High-speed Data Converter-to-FPGA interface
Demystifying the JESD204B High-speed Data Converter-to-FPGA interface
 
San
SanSan
San
 
San
SanSan
San
 

Último

3.21.24 The Origins of Black Power.pptx
3.21.24  The Origins of Black Power.pptx3.21.24  The Origins of Black Power.pptx
3.21.24 The Origins of Black Power.pptxmary850239
 
CAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxCAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxSaurabhParmar42
 
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptxSandy Millin
 
Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICESayali Powar
 
Human-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesHuman-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesMohammad Hassany
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17Celine George
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...raviapr7
 
Patterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptxPatterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptxMYDA ANGELICA SUAN
 
UKCGE Parental Leave Discussion March 2024
UKCGE Parental Leave Discussion March 2024UKCGE Parental Leave Discussion March 2024
UKCGE Parental Leave Discussion March 2024UKCGE
 
How to Solve Singleton Error in the Odoo 17
How to Solve Singleton Error in the  Odoo 17How to Solve Singleton Error in the  Odoo 17
How to Solve Singleton Error in the Odoo 17Celine George
 
How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17Celine George
 
What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?TechSoup
 
Diploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfDiploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfMohonDas
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17Celine George
 
The Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsThe Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsEugene Lysak
 
CapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapitolTechU
 
5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...CaraSkikne1
 
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdfP4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdfYu Kanazawa / Osaka University
 
Benefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationBenefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationMJDuyan
 
In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxAditiChauhan701637
 

Último (20)

3.21.24 The Origins of Black Power.pptx
3.21.24  The Origins of Black Power.pptx3.21.24  The Origins of Black Power.pptx
3.21.24 The Origins of Black Power.pptx
 
CAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxCAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptx
 
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
 
Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICE
 
Human-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesHuman-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming Classes
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...
 
Patterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptxPatterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptx
 
UKCGE Parental Leave Discussion March 2024
UKCGE Parental Leave Discussion March 2024UKCGE Parental Leave Discussion March 2024
UKCGE Parental Leave Discussion March 2024
 
How to Solve Singleton Error in the Odoo 17
How to Solve Singleton Error in the  Odoo 17How to Solve Singleton Error in the  Odoo 17
How to Solve Singleton Error in the Odoo 17
 
How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17
 
What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?
 
Diploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfDiploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdf
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17
 
The Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsThe Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George Wells
 
CapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptx
 
5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...
 
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdfP4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
 
Benefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationBenefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive Education
 
In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptx
 

Vsam presentation PPT

  • 2. 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
  • 3. 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
  • 4. 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
  • 5. VSAM  VSAM acts as interface between  Operating System and Application Program V Request S Reply Operating Application A System M
  • 6. VSAM  Interface between Main Storage and Disk V S Main Storage DATA A DATA Disk M
  • 7. 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
  • 8. 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
  • 9. 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.
  • 10. 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 INDEX CLUSTER DATA
  • 11. VSAM internals  CONTROL INTERVAL (CI)  VSAM stores Data and Index in Control Intervals (CI)  CI is similar to ‘Block’ CI Record Record .......
  • 12. CONTROL INTERVAL  CI is the unit of retrieval between DASD and I/O Buffer (Virtual Storage) DASD I/O Buffer CI R1 R2 R3 R1 R2 R3
  • 13. Control Interval  CI contains  Records (or DATA)  Free space (Optional)  Control Information Definition Field (CIDF)  Record Definition field (RDF)
  • 14. 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.
  • 15. CONTROL INTERVAL  CIDF & RDF are VSAM control functions  Used by VSAM to access data R R C R1 R2 Free D I R3 D Space F D F F 3 bytes, Length of Record How many successive records have same length 4 bytes long, One per CI Indicates Free space, where and how much
  • 16. 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 CIDF LR LR LR LR.. FS....FS... RDF CIDF LR LR LR LR.. FS....FS... RDF CIDF
  • 17. Cluster  VSAM datasets are defined as Highest Index Set Clusters. 2210 5000  A Cluster is a combination of the data component and the index Index Set component. 1055 1600 FS 5000 FS FS  The Index component is applicable only in the case of a KSDS. Sequence Set  The data component holds data 1010 1055 FS 1350 1600 FS records.  The index component holds the index records to access the required DATA COMPONENT (CA1) information from the data component 1300 1305 1310 1350 FS 1400 1410 1415 1600 FS Data Component (CA2) FS FS FS FS FS 1001 1002 1005 1010 FS 1020 1022 1030 1055 FS FS FS FS FS FS
  • 18. Control Interval Split CA-1 (CI-1 to CI-3) - Before split  When a data set is first loaded, the key sequence of records and 1001 1002 1005 1010 FS their physical order are the same.  However, when records are 1020 1022 1030 1055 FS inserted, control interval split can occur, causing the data control intervals to have a physical order FS FS FS FS that is different from the key sequence.  For example, try to insert '1004' CA-1 (CI-1 to CI-3) - After split in CI-1 shown below :  A Control Interval Split occurs 1001 1002 1004 FS and CI-1 is split exactly into two half CI's. CI-3, which is a free 1020 1022 1030 1055 FS control interval is used, and some logical records of CI-1 are moved into CI-3. CI-3 is placed after CI- 1005 1010 FS FS 2 and it is not inserted in between CI-1 and CI-2.
  • 19. 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
  • 20. Types of VSAM data sets  ESDS Entry Sequenced Data Set  KSDS Key Sequenced Data Set  RRDS Relative Record Data Set  LDS Linear Data Set
  • 21. ORGANIZATION SEQUENTIAL => ESDS INDEXED => KSDS RELATIVE => RRDS ACCESS MODE OPTIONS ESDS : SEQUENTIAL KSDS : SEQUENTIAL or RANDOM or DYNAMIC RRDS: SEQUENTIAL or RANDOM or DYNAMIC
  • 22. 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.
  • 24. 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.
  • 25. Sample JCL to create an ESDS cluster //LEM0UXXA JOB MSGCLASS=Q,CLASS=Q,NOTIFY=&SYSUID //DEFKSDS EXEC PGM=IDCAMS NONINDEXED - ESDS //SYSPRINT DD SYSOUT=* //SYSIN DD * DEFINE CLUSTER(NAME(LEM0UXX.TEST.ESDS) - VOLUMES(LEM001) - RECORDSIZE(N1,N2) NONINDEXED - TRACKS(2,1) - N1=> AVG RECL RECORDSIZE(50,50) - N2=> MAX RECL CONTROLINTERVALSIZE(4096) - FREESPACE(10,20)) - DATA(NAME(LEM0UXX.TEST.ESDS.DATA)) /* Freespace(PCT1,PCT2) PCT1=> PCT FREE SPACE IN each CI PCT2=> PCT Of unused CI in CA
  • 27. 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
  • 28. ESDS (Contd...)  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
  • 29. RBA  Record location relative to the beginning of the file (Relative Byte Address) CI R1 R2 R3 80 40 60 RBA of R1 is 80
  • 30. 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]
  • 31. ESDS  ORGANIZATION IS SEQUENTIAL  ACCESS MODE IS SEQUENTIAL INPUT OUTPUT INPUT- EXTEND OUTPUT READ YES - YES - WRITE - YES YES DELETE REWRITE YES
  • 32. VSAM === ESDS ORGANIZATION IS SEQUENTIAL. ACCESS MODE = SEQUENTIAL OVERVIEW
  • 38. View the data from ESDS REPRO COMMAND
  • 44. Sample JCL to create a KSDS cluster KEYS(N1,N2) //LEM0UXXA JOB MSGCLASS=Q,CLASS=Q,NOTIFY=&SYSUID N1=> length of the Key(Bytes) //DEFKSDS EXEC PGM=IDCAMS N2=> is starting byte position //SYSPRINT DD SYSOUT=* of Key in Record //SYSIN DD * DEFINE CLUSTER(NAME(LEM0UXX.TEST.KSDS) - RECORDSIZE(N1,N2) VOLUMES(LEM001) - N1=> AVG RECL TRACKS(2,1) - N2=> MAX RECL INDEXED - KEYS(9,0) - INDEXED - KSDS RECORDSIZE(50,50) - CONTROLINTERVALSIZE(4096) - Freespace(PCT1,PCT2) FREESPACE(10,20)) - PCT1=> PCT FREE SPACE IN each CI DATA(NAME(LEM0UXX.TEST.KSDS.DATA)) - PCT2=> PCT Of unused CI in CA INDEX((NAME(LEM0UXX.TEST.KSDS.INDEX))
  • 45. SELECT & ASSIGN Syntax ENVIRONMENT DIVISION. INP UT- OUT P UTSECT ION. FILE - CONT ROL. SELECT [OP T IONAL FileName ] ASSIGN T O FileSpec ORGANIZAT I IS INDEXED ON SEQUENT IAL ACCESS MODE IS RANDOM DYNAMIC RECORD KEY IS UniqueRecKey ALT ERNAT ERECORD KEY IS AltKey WIT HDUP LICAT ES FILE ST AT US IS FileStatus
  • 46. READ statement READ FileName RECORD INTO DestItem KEY IS KeyName INVALID KEY StatementBlock END READ READ FileName NEXT RECORD INTO DestItem AT END StatementBlock END READ
  • 47. WRITE & REWRITE statement WRITE RecName FROM SourceItem INVALID KEY StatementBlock END WRITE REWRITE RecName FROM SourceItem INVALID KEY StatementBlock END REWRITE
  • 48. KSDS  ORGANIZATION IS INDEXED  ACCESS MODE IS SEQUENTIAL INPUT OUTPUT INPUT- OUTPUT READ YES - YES WRITE - YES DELETE YES REWRITE YES START YES YES
  • 49. INDEX FILE ORGANIZATION IS INDEXED. ACCESS MODE = SEQUENTIAL OVERVIEW
  • 56. READING INDEX FILE-KSDS ORGANIZATION IS INDEXED. ACCESS MODE = SEQUENTIAL OVERVIEW
  • 59. EXECUTE A PROGRAM FOR READING DATA FROM KSDS
  • 62. START & DELETE statement IS EQUAL TO IS = IS GREATER THAN START FileName KEY KeyName IS > IS NOT LESS THAN IS NOT < INVALID KEY StatementBlock END START DELETE FileName RECORD INVALID KEY StatementBlock END DELETE
  • 68. EXECUTE A PROGRAM AFTER COMPILE
  • 69. PRINT THE KSDS DATASET
  • 72. KSDS  ORGANIZATION IS INDEXED  ACCESS MODE IS RANDOM INPUT OUTPUT INPUT- OUTPUT READ YES - YES WRITE - YES YES DELETE YES REWRITE YES START
  • 74. KSDS – Random -WRITE
  • 75. KSDS –RANDOM MODE READ Operation Overview
  • 79. 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
  • 80. KSDS- DYNAMIC MODE WRITE OPERATION Overview
  • 86. Sample JCL to create an RRDS cluster //LEM0UXXA JOB MSGCLASS=Q,CLASS=Q,NOTIFY=&SYSUID //DEFRRDS EXEC PGM=IDCAMS NUMBERED - RRDS //SYSPRINT DD SYSOUT=* //SYSIN DD * DEFINE CLUSTER(NAME(LEM0UXX.TEST.RRDS) - RECORDSIZE(N1,N2) VOLUMES(LEM001) - N1=> AVG RECL NUMBERED - N2=> MAX RECL TRACKS(2,1) - RECORDSIZE(50,50) - CONTROLINTERVALSIZE(4096) - Freespace(PCT1,PCT2) FREESPACE(10,20)) - PCT1=> PCT FREE SPACE IN each CI DATA(NAME(LEM0UXX.TEST.RRDS.DATA)) PCT2=> PCT Of unused CI in CA /*
  • 97. ALTERNATE INDEXES  Used whenever the data is required to be retrieved on the basis of m 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 IS ENAME IS BASE KEY ALTERNATE KEY
  • 98. ALTERNATE INDEXES Reduce data redundancy Can have duplicates Easy to define using IDCAMS Allow datasets to be accessed sequentially or randomly Can be updated automatically
  • 99. Disadvantages  Performance degradation  Complex update logic
  • 100. 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
  • 101. Sample JCL to create an AIX cluster UPGRADE-> VSAM AUTOMATIC Updates the AIX for all ADD,UPDT,DEL of Base cluster //LEM0UXXA JOB MSGCLASS=Q,CLASS=Q,NOTIFY=&SYSUID //DEFKSDS EXEC PGM=IDCAMS UNIQUE /NONUNIQUE //SYSPRINT DD SYSOUT=* //SYSIN DD * DEFINE AIX (NAME(LEM0UXX.TEST.AIX.CLUSTER) – KEY ( N1,N2) RELATE (LEM0UXX.INFILE.KSDS) - N1-> LENGTH OF AIX key VOLUMES(LEM001) - KEY (10, 35) - N2-> KEYS start Loc in BASE CLUSTER TRACKS(2,1) - NONUNIQUEKEY - RECORDSIZE(N1,N2) RECORDSIZE(49,49) - N1=> AVG RECL UPGRADE CONTROLINTERVALSIZE(4096) - N2=> MAX RECL FREESPACE(10,20)) - DATA(NAME(LEM0UXX.TEST.AIX.DATA)) INDEX(NAME(LEM0UXX.TEST.AIX.INDEX)) Freespace(PCT1,PCT2) /* PCT1=> PCT FREE SPACE IN each CI PCT2=> PCT Of unused CI in CA
  • 102. UPGRADE/NOUPGRADE • Syntax : UPGRADE/NOUPGRADE • UPGRADE specifies that records in AIX are to be updated • automatically whenever the base cluster is updated
  • 104. BUILD INDEX //JOB CARD //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* BUILD INDEX is used //SYSIN DD * To load records in BLDINDEX - INDATASET(LEM0UXX.KSDS.CLUSTER') - AIX after it has been def OUTDATASET('LEM0UXX.KSDS.AIX.CLUSTER') - /*
  • 106. DEFINE PATH //JOB CARD //STEP1 EXEC PGM = IDCAMS Path Establishes //SYSPRINT DD SYSOUT=* A Bridge Between //SYSIN DD * BASE CLUSTER & AIX DEFINE PATH - ( NAME ( LEM0UXX.KSDS.PATH) – PATHENTRY(LEM0UXX.KSDS.AIX.CLUSTER) – UPDATE ) /* //
  • 109. LOADING DATA INTO BASE CLUSTER
  • 110. LOADING DATA INTO BASE CLUSTER
  • 111. LOADING DATA INTO BASE CLUSTER
  • 112. EXECUTING A PROGRAM TO LOAD DATA
  • 113. EXECUTING A PROGRAM TO LOAD DATA
  • 114. DEFINING AIX RECORDSIZE(N1,N2) N1= LENGTH OF BASE CLUSTER KEY(3) + LENGTH OF AIX KEY(5) + 5 for CI
  • 116. Create path for Bridge
  • 117. READING RECORDS BY ALTERNATE INDEX
  • 118. READING RECORD BY ALTERNATE KEY
  • 119. READING RECORD BY ALTERNATE KEY
  • 120. EXECUTE A READ PROGRAM BY ALTERNATE KEY DD1-> BASE CLUSTER DD11-> PATH NAME DDNAME SHOULD BE IN ORD