Vous êtes sur la page 1sur 60

Mainframe CHAPTER - 1: Introduction to VSAM

VSAM

Virtual Storage Access Method - VSAM - is a data management system introduced by IBM in the 1970s as part of the OS/VS1 and OS/VS2 operating systems. Although there are still datasets that are best managed with the several other (non-VSAM) data management methods, VSAM is a major component of modern IBM operating systems. VSAM is a high performance access method used to organize data and to maintain information about that data in an index or library called a catalog. VSAM acts as interface between Operating System and Application Program. VSAM is an access method used to organize data and maintain information about the data in a catalog. All VSAM data sets reside on DASD Devices and must be defined in a catalog. There are two major parts to VSAM: Catalog management Record management

Catalog Management The catalog contains information about the VSAM data sets. The catalog can be an ICF Catalog or a VSAM catalog (older versions of the operating system). DFSMS/MVS deals only with ICF catalogs. All VSAM data set information is maintained in the ICF catalog and it can be easily retrieved using AMS commands (Access Method Services).

Record management The purpose of record management is to maintain records in a VSAM data set for an application or a system program. VSAM supports five data set organizations: Key-sequenced data set (KSDS) Entry-sequenced data set (ESDS) Fixed-length relative record data set (RRDS) Variable-length relative record data set (VRRDS) Linear data set (LDS)

The primary difference between the VSAM data set organizations is in the way the records are stored and accessed. VSAM HISTORY In the year 1973 VSAM was introduced with ESDS & KSDS only and in the year 1975 the concept of Alternate Index, RRDS, and Catalog Recovery features were introduced. VSAM was re-introduced with a facility called as Integrated Catalog Facility (ICF). In the year 1983 VSAM was introduced with DFP/VSAM (Data Facility Product) which can run under MCS/XA. Later in the year 1987 the DFP/VSAM 2.3 with LDS facility was introduced and another VSAM 3.1 under MVS/ESA with DFSMS (Data Facility Storage Management System). In the year 1991, VSAM 3.3 was introduced with variable length records for RRDS

iFrames Technologies

Mainframe STRUCTURE OF VSAM

VSAM

VSAM provides a comprehensive catalog facility that stores information about VSAM data sets and other files. There are two types of catalogs: Master Catalogs User Catalogs

Master Catalog Every system that uses VSAM has one, and only one, master catalog. The master catalog contains entries about system datasets and VSAM structures used to manage the operation of VSAM. The master catalog is created during the System Generation process and usually resides on the System Residence volume. The master catalog "owns" all other VSAM resources in a computer system, and this is denoted by the position of the master catalog. User Catalogs A user catalog is a catalog created to contain entries about application specific datasets. The information defining a user catalog is stored into a catalog entry in the master catalog. A production system might have any number of user catalogs, with the datasets cataloged in a specific user catalog related by application type.

ADVANTAGES & DISADVANTAGES OF VSAM Advantages: The retrieval of records is faster because of an efficiently organized index. The index is small because of a key compression algorithm used to store and retrieve its records. Imbedded free space makes the insertion of records easy, and data sets therefore require less reorganization. The deletion of records in VSAM, unlike that in ISAM, means that they are physically deleted, thus allowing the reclaiming of free space within the data set. VSAM data sets are device-independent. VSAM catalogs and data sets are portable between operating systems. Records can be accessed randomly by key or by address and can also be accessed sequentially at the same time. To take advantage of the partial self-reorganization capabilities of VSAM data sets, free space must deliberately be left. For data sets that are used for read only purposes, no free space is required. Except for read-only data sets, the integrity of VSAM data sets in crosssystem and cross region sharing must be controlled by the user. Data integrity must be a prime consideration in the initial design of applications that will be shared across systems.

Disadvantages:

iFrames Technologies

Mainframe MAJOR AREAS WHERE VSAM IS USED

VSAM

It can be used as a stand-alone product. VSAM data sets can be created and processed by a powerful software product called IDCAMS. Batch application programs in COBOL, PL/I, Assembler, etc. can access VSAM data sets. In data set management, PDS directories, catalogs, and generation data groups can be manipulated through specific IDCAMS commands. GDGs and catalogs are themselves VSAM data sets, Also, the IDCAMS utility can be used to process older, non-VSAM data set organizations. Many major IBM software products, such as CICS, IMS, DB2 and TSO, use VSAM data sets in a majority of applications. In some of them, VSAM data sets are the only ones that are compatible.

VSAM is available under all IBMs Mainframe operating systems; MVS, VM, and VSE. The MVS implementation of VSAM is the most comprehensive. Also, VSAM data sets can be stored on almost all standard disk drives, such as 3390, 3380, 3350, 3370, etc. Present and future mainframe software released by IBM will be designed to process records storage in VSAM data sets. VSAM is going to be around for a long time to come. VSAM TERMINOLOGY Before we discuss VSAM data set organizations in detail, we need to review some terms that will be used throughout the book. Logical record Control interval Control area

Logical record (LR) A logical record is a unit of information used to store data in a VSAM data set. Logical records in VSAM data sets are stored differently than logical records in nonVSAM data sets.

LR
A LR is comparable to the logical-record length (lrecl) for a Non-Vsam dataset, as in the DCB Parameter of JCL. Control Interval (CI) Logical records are contained in a control interval (CI). A group of LRs will make one CI.

LR

LR

LR

LR

The fundamental building block of every component of a VSAM data set is the control interval. A control interval is the unit of information that VSAM transfers between the storage device and the virtual storage. One CI can be made of one or more physical blocks of DASD.

iFrames Technologies

Mainframe

VSAM

Control Interval Format for a Non- LDS Cluster.


Logical Record Area Free space Area Control Interval Definition field

Record definition field

RECORD 1 RECORD 2

R D F 1

R D F 2

A CI consists Logical records stored from beginning to end Unused space, referred to as free space, for data records to be inserted into or lengthened The maximum size of a CI is 32k and the minimum size is 512 bytes. Control information, which is made up of two types of fields; one Control Interval Definition Field (CIDF) per CI, and one or more Record Definition Fields (RDF) per logical record.

1. CIDF is a 4-byte field. It contains information about the length of data in the CI and the amount and location of free space. 2. RDF is a 3-byte field. It describes the length of records and how many adjacent records are of the same length. Control area (CA) A control area (CA) is one or more CIs put together into fixed-length contiguous areas of DASD. A VSAM data set is composed of one or more CAs. The number of CIs in a CA is fixed by VSAM. The CA size is implicitly defined when you specify the size of a data set at data set definition. The maximum size of a CA is one cylinder and the minimum size is one track.

iFrames Technologies

Mainframe Figure 1-2 shows the structure of a CA.

VSAM

CA1

LR1

LR2

FREE SPACE

RDF2

RDF1

CIDF

CA2

LR3

LR4

FREE SPACE

RDF4 RDF1

CIDF

CA3

LR5

LR6

FREE SPACE

RDF

RDF

CIDF

CA 1

REVIEW QUESTIONS 1. What is VSAM? 2. What are the major parts in VSAM? 3. What are the two Catalogs available in VSAM? 4. What is Control Interval? 5. What is Control Area? 6. How many Bytes occupied for RDF and CIDF? 7. The Maximum and minimum size of a Control Area is __________, _________. 8. What are the advantages and disadvantages of VSAM? 9. What are the different datasets supported by VSAM? 10. What is a logical record? 11. What's the biggest disadvantage of using a VSAM dataset?

iFrames Technologies

Mainframe CHAPTER --- 2 : Dataset Organization

VSAM

VSAM DATASET ORGANIZATION

LR1

LR2

LR3

CI

LR2

WORK AREA

Whenever a record is retrieved from DASD, the entire CI containing the record is read into a VSAM I/O buffer in virtual storage. From the VSAM buffer, the desired record is transferred to a user defined buffer or work area. The physical organization of VSAM data sets differs considerably from those used by other access methods. VSAM data sets are held in control intervals and control areas; the size of these is normally determined by the access method, and the way in which they are used is not visible to you. TYPES OF DATASET ORGANISATION VSAM supports 5 different organizations. They are as follows: Linear Data Set LDS with no record organization Entry-Sequenced Data Set ESDS - is like a standard sequential data set. Fixed-length Relative-Record Data Set - FRRDS - Fixed length RRDS Variable-length Relative Record Data Set - VRRDS - Variable length RRDS Key-Sequenced Data Set KSDS- is like an indexed sequential access method file.

The VSAM data set organizations are superior to the native access methods. VSAM provides for alternate indexes, a feature not available in native access methods. It has an admirable catalog facility that stores more information about VSAM and other data sets. The powerful AMS utility in VSAM provides a variety of services dealing with catalogs, files, security, file management, etc. It provides

iFrames Technologies

Mainframe

VSAM

comprehensive support for application development in many environments such as COBOL, PL/I, FORTRAN, Assembler and CICS. LINEAR DATA SET (LDS) A linear data set (LDS) contains data that can be accessed as byte-addressable strings in virtual storage. It is a VSAM data set with a control interval size of 4096 bytes.

DATA CA

DATA DATA DATA

DATA CA

DATA DATA DATA

An LDS has no imbedded control information in its CI, which is, no RDFs and CIDFs. All LDS bytes are data bytes. Logical records must be blocked and de blocked by the application program, but records do not exist from the point of view of VSAM. An LDS contains a data component only. LDS are generally used for fast random access to data that has no hierarchical structure - i.e., for data, that is a large flat file, such as a table or array. A relational database is just this. You specify the LDS organization with the IDCAMS DEFINE command specifying the LINEAR parameter. ENTRY SEQUENCED DATA SET (ESDS) An ESDS is a sequential file, in which records are typically retrieved in the order in which they were written to the data set and additions are always made at the end of the file. Each record can be identified by a relative byte address or RBA. Records cannot be physically deleted. Since records in an ESDS are not sequenced on any key field, there is no primary key index component. Imbedded free space is not allocated at the time of allocation of an ESDS, since records are not added to the middle of the file. Records in an ESDS may be of variable length.

iFrames Technologies

Mainframe CI 1
RECORD1 RECORD2 RECORD3 RECORD4

VSAM

RBA

0
CI 2
RECORD5 RBA RECORD6 RECORD7 RECORD8

4096
CI 3 UNUSED SPACE RBA 8192

Records can be updated, but without length change. To change the length of a record, you must either store it at the end of the data set as a new record, or override an existing record of the same length that you have flagged as inactive. A record can be accessed sequentially or directly by its RBA: Relative Byte Address (RBA) is the address of a record in a dataset. Records can be accessed sequentially or by relative byte address (RBA).The RBA of the first logical record is 0. The second record has an RBA equal to the length of the first record and so on. TYPICAL ESDS PROCESSING Sequential processing: VSAM automatically retrieves records in stored sequence. Sequential processing can be started from the beginning or somewhere in the middle of a data set. If processing is to begin in the middle of a data set, positioning is necessary before sequential processing can be performed. Direct processing: When a record is loaded or added, VSAM indicates its RBA. To retrieve records directly, you must supply the RBA for the record as a search argument. Although an ESDS does not contain an index component, you can build an alternate index to keep track of these RBAs. Empty spaces in the CI are referred to as unused space because they can never be used. You specify ESDS organization using the IDCAMS DEFINE command and specifying the NONINDEXED parameter.

iFrames Technologies

Mainframe RELATIVE RECORD DATASET (RRDS) 1) FIXED LENGTH RECORDS

VSAM

In an RRDS the entire data set is a string of fixed length slots. Each slot occupies a fixed position and is identified by its position relative to the first slot of the data set.

RECORD1

RECORD2 RECORD6 RECORD10

RECORD3 RECORD7 RECORD11

RECORD4 RECORD8 RECORD12

DATA CA

RECORD5 RECORD9

RECORD13

RECORD14 RECORD18 RECORD22

RECORD15 RECORD19 RECORD23

RECORD16 RECORD20 RECORD24

DATA CA

RECORD17 RECORD21

The relative position of each slot is called relative record number (RRN). An RRN is an integer that identifies the position of the slot no the value of a particular field within the slot. Each slot of an RRDS may or may not contain a record. Records in an RRDS may be inserted, retrieved, updated, and deleted both sequentially and randomly. Records in an RRDS are always fixed in the length. RRDS has only data component. When a record is deleted from a particular slot, the slot remains in the same physical location although a record does not exist in that slot anymore You specify the RRDS organization using the IDCAMS DEFINE command with the NUMBERED option. TYPICAL RRDS PROCESSING CONTROL AREA 2 CI

APPLICATION PROGRAM GET RECORD 25

29

30

31

32 CI

25

26

27

28
CI

CI

13 9 5

14 10

15 11 6 7

16
CI

21 17

22 18

23 19

24
CI

12
CI

20

SLOT 8

8
CI

CONTROL AREA 1

Slot8 9

1 2 3 iFrames Technologies

Mainframe

VSAM

The relative record number can be used as a search argument. The application program inputs the relative record number of the target record and VSAM is able to find its location quickly using an internal algorithm. An RRDS can be processed sequentially, directly or skip-sequentially. RRDS sequential processing is treated the same way as ESDS sequential processing. Empty slots are automatically skipped by VSAM. An RRDS can be processed directly by supplying the relative record number as a key. VSAM accesses the appropriate slot and returns the record to the users buffer. RRDS direct address processing by supplying the RBA is not supported. Skip-sequential processing is treated like an RRDS direct processing request, but the position is maintained. Records must be in ascending sequence.

2. VARIABLE RELATIVE RECORD DATA SET (VRRDS) A VRRDS is similar to a fixed-length RRDS, except that it contains variablelength records. Each record has a unique relative record number, and is placed in ascending relative record number order. Each record is stored and retrieved using its relative record number. VRRDS has no preformatted slots. The relative record number of a record cannot change. When that record is erased, the relative record number can be reused for a new record. You can specify free space for inserting records and increasing the length of a record. VRRDS is a KSDS processed as an RRDS, so an index will be created. You specify the VRRDS organization with the IDCAMS DEFINE command with the NUMBERED option and variable length record. REVIEW QUESTIONS. 1. Which VSAM cluster support only fixed length records? a) LDS b) RRDS c) ESDS d) KSDS 2. FREESPACE can be specified for which type of cluster? a) LDS b) B. RRDS c) C. ESDS d) D. KSDS 3. For a KSDS, the larger the data CA size, the smaller the number of index CIs. A. TRUE B. FALSE.

iFrames Technologies

10

Mainframe

VSAM

4. VSAM control intervals containing data records have at least one RDF and one CIDF. A. TRUE B. FALSE 5. In which cluster type are records always added at the end of the data set? a) b) c) d) 6. LDS RRDS ESDS KSDS

Which VSAM clusters support only fixed length records? a) LDS b) RRDS c) ESDS d) KSDS

7. The types of processing supported by RRDS are a) b) c) d) e) sequential skip-sequential direct a and b a, b and c

8. The types of processing supported by ESDS are a) b) c) d) e) Sequential skip-sequential Direct a and b a and c

9. What is the Difference between LDS & ESDS? 10. How Many Times Secondary Space Allocated? 11. What is the RRN for the first record in RRDS?

iFrames Technologies

11

Mainframe CHAPTER - 3: KSDS KEY SEQUENCED DATASET (KSDS)

VSAM

In a KSDS, records are placed in the data set in ascending collating sequence by key. The records for KSDS can be fixed-length or variable-length records. The key of the record contains a unique value that determines the record's collating position in the data set. The key must be in the same position in each record.

INDEX COMPONENT

DATA COMPONENT

The key data must be contiguous and each record's key must be unique. After it is specified, the value of the key cannot be altered, but the entire record can be deleted. When a new record is added to the data set, it is inserted in its collating sequence by key. A KSDS has a data and an Index Component. The Index Component keeps track of the used keys and is used by VSAM to retrieve quickly a record from the data component, when a request is made for a record with a certain key. A KSDS can have fixed or variable length records. A KSDS can be accessed either sequentially or directly or skip-sequentially. You specify the KSDS organization using the IDCAMS DEFINE command with the INDEXED parameter. DATA / INDEX RELATIONSHIP A KSDS has an index that relates key values to the relative locations of the logical records in a data set. This index is called the Prime Index. It has two uses: Locate the collating position when inserting records. Locate records for retrieval.

When initially loading a data set, records must be presented to VSAM in key sequence. The Index is built automatically by VSAM as the data set is loaded with records. When a data CI is loaded with records, VSAM makes an entry in the index. The entry consists of the highest possible key in the data CI and a pointer to the beginning of that CI. VSAM index can consists of more than one index level. Each level contains a set of records with entries giving The location of the records in the next lower level.

iFrames Technologies

12

Mainframe Sequence Set: contains the index CIs at the lowest level.

VSAM

There is one CI in the sequence set for each data CA. It contains pointers and high key information for each CI within the data CA. It contains also horizontal pointers from one sequence set CI to the next sequence set CI. Index Set: remainder of the index component. If there is more than one sequence set level record, VSAM automatically builds another index level. Each CI in the index set contains pointers and high key information for CIs in the next lower level of the index.

Index Component

IS1 IS2IS3

Index set

SS1

SS2

SS3

SS4

SS5

Sequence set

CA1 CI1 Data Component CI2 CI3

CA2 CI1 CI2 CI3

CA3 CI1 CI2 CI3

CA4 CI1 CI2 CI3

CA5 CI1 CI2 CI3

TYPICAL KSDS PROCESSING: INDEX COMPONENT 079 236

007 001

021 002

079 004

FS 007

099

124

236

FS

DATA COMPONENT 008 0 079 012 018 021

67

iFrames Technologies

13

Mainframe

VSAM

CONTROL AREAS There are three methods by which to access a KSDS. These are sequential, direct, or skipsequential.

084

087

099

111 2

124

Sequential access is used to load a KSDS, and to retrieve, update, add and delete records in an existing data set. Sequential access means that records are retrieved one-by-one, starting from the first record, in the order that they are placed in the dataset.. When retrieving records, you do not need to specify key values because VSAM automatically obtains the next logical record in sequence. The sequence set is used to find the next logical CI. Sequential access allows you to avoid searching the index more than once. Sequential is faster than direct for accessing multiple data records in ascending key order. Direct access is used to retrieve, update, add and delete records in an existing data set. You need to supply a key value for each record to be processed. You can supply the full key or a generic key. The generic key is the high order portion of a full key. For example, you might want to retrieve all records whose keys begin with XY (where XY is the generic key), regardless of the full key value. VSAM searches the index from the highest-level index set CI to the sequence set for a record to be accessed. Vertical pointers in the sequence set CI are used to access the data CA containing the record. Direct access saves you a lot of overhead by not retrieving the entire data set sequentially to process a small percentage of the total number of records. Skip-sequential access is used to retrieve, update, add and delete records in an existing data set. In skip-sequential method of access, the record pointer can be placed anywhere within the dataset (by giving the key) and records can then be retrieved sequentially from that point. LOADING A KSDS: When loading a KSDS, logical records are stored in ascending key sequence within a data CI. The data component for a KSDS can contain user specified FREESPACE. This free space is used later, when records are inserted or expanded. CI Free Space: Percentage of CI left empty / unused at load time. CA Free Space: Percentage of CIs in each data CA empty / unused at load FS time. SEQUENCE SET CI 4037 4065 4077

38

iFrames Technologies

14

Mainframe

VSAM

CI 0 CI 1

4012 4041 4072

4023 4050 4073

4034

4037

FREE SPACE FREE SPACE FREE SPACE

4052 4085 4075 4077

CI 2

CI 3

FREESPACE

UPDATING A KSDS CLUSTER: Insertion: While Inserting a Record in the KSDS Cluster, the records are placed in logical sequence. The CI free space is used. The Index Component is not altered. Deletion: While deleting a record from the KSDS Cluster, the records are physically removed from CI. The records in CI with higher keys are shifted left and the available free space in the CI is increased. The Index Component is not altered. INSERT 4058 SEQUENCE SET CI

4037

4065

4077

FS

CI CI DATA CA CI 2

0 1

4012 4041 4072

4023 4050 4073

4034 4052 4075

4037 4058 4077

FREESPACE 4065 FREESPACE

CI

FREE SPACE

CONTROL INTERVAL SPLIT When inserting a record in the CI, if there is no enough free space in the CI, then the CI will be split as follows:

iFrames Technologies

15

Mainframe

VSAM

Half of the full CI is moved to an empty / free CI within same CA. So, CA free space is used. A new index entry is inserted in the sequence set record. The existing index entry is updated in the sequence set record.

As a result of the CI split, the physical sequence of the data is no longer the same as the logical sequence. This will be illustrated by the following diagram. . INSERT 4046 SEQUENCE SET

4037

4050

4065 4077

4012
CI 0

4023 4034 4037

FREE SPACE

4041
CI DATA CA CI 2 1

4046

4050

FREE SPACE

4072

4073

4075

4077 FREE SPACE

4052

4058

4065

FREE SPACE

CI

CONTROL AREA SPLIT When there are no more free CI s in the CA then VSAM performs a control area split. o o o o o VSAM allocates a new CA at the end of the data component Approximately half of the data CI s are moved from the full CA to the new CA. A new sequence set CI is created for the new data CA. The old sequence set CI is modified The index set is updated. In the given below example a new index set

CI will be created that will be the highest-level index set CI. Then VSAM performs a control Interval split. This will be illustrated by the following diagram.

iFrames Technologies

16

Mainframe

VSAM

TO INSERT 4074

BEFORE

AFTER

SEQUENCE SET CI 4037 4050 4065 4077

INDEX SET CI

4065

4077
SEQUENCE SET CI

4037 4050 4065 40654040654065


4012 4041 4072 4052 4023 4046 CA1 4073 4058 4075 4034 4050 4076 4065 4077 4037 4012 4041 4052 4023 4046 4034

4074

4077

4037

4050 4065 FREE SPACE

4058

4072 4076 CA2

4073 4077

4074 4075

FREE SPACE FREE SPACE

SPANNED RECORDS Spanned records are records with a record size greater than the CI size specified.

iFrames Technologies

17

Mainframe Spanned records can only be used in ESDS or KSDS organizations.

VSAM

Spanned records can span control intervals, but not control areas. So, one spanned record is stored in several CIs.

RECORD 1

RECORD 1 R R SEGMENT1 D D F F 2 1

C I D F

RECORD 1 R R SEGMENT2 D D F F 2 1

C I D F

RECORD 1 UNUSED R SEGMENT3 SPACE D F 2

R C D I F D 1 F

As in the above diagram, the spanned record spans three CIs. The segment of the first CI contains part of data along with two RDFs and one CIDF. The right RDF gives the length of the segment. The left RDF gives the update number of the segment (used to maintain update consistency of all segments during an update). A CI that contains the records segment of a spanned record contains control information. However a new record cannot be inserted into the same CI. As in the diagram, the third CI contains the spanned data, and the rest of the space becomes unused space. A new record would move into the fourth CI. ACCESSING SPANNED RECORDS Spanned records must be accessed in MOVE mode. The application program must contain a work area as the largest spanned record in the data set.

iFrames Technologies

18

Mainframe

VSAM

DATA BUFFERS

CI 1 CI 2 CI 3

WORK AREA

ADDRESS SPACE
REVIEW QUESTIONS: 1. Specifying CISZ (4096) at the cluster level for a KSDS results in a) VSAM ignoring the specification b) Data and index CISZ 4k each c) Data CISZ 4k; index CISZ selected by VSAM 2. 3. 4. What is the use of Free Space in KSDS? How do you define a KSDS? VS COBOL II supports SKIP processing. a) TRUE b) FALSE 5. VSAM request macros (e.g., GET, PUT) point to which other macro(s)? a) OPEN b) ACB c) RPL d) CLOSE e) (B) and (C) 6. NONSPANNED records may be accessed in either MOVE mode or LOCATE mode. a) b) 7. 8. TRUE FALSE

What does a file status of 02 on a VSAM indicate? Explain CI split and CA split

iFrames Technologies

19

Mainframe CHAPTER - 4: ACCESS METHOD SERVICES (AMS)

VSAM

One of VSAMs strength is that a single set of data management facilities called Access Method Service (AMS) manages both VSAM and non-VSAM datasets. IDCAMS is a general-purpose utility program, used with VSAM, to establish and maintain catalogs and data sets. It provides the services described above, and more. AMS uses a command processor called IDCAMS to handle a variety of functions such as creating, reproducing, printing datasets and listing catalog contents. These functions of AMS are performed thru functional commands. A functional command can have one or more parameters that can be positional or keyword. Positional parameters are identified by its position in relation to other parameters: a keyword parameters can be used in any place in relation to other keyword parameters because it is identified by the particular keyword used. Types of AMS commands Functional commands Modal commands Function Changes information specified for a catalog, alternate index, or path at define time. Builds an alternate index. ALTERNATE Defines an alternate index. List information about data sets Copies records from one file to another. The input and output files can be VSAM or non-VSAM Prints the contents of a VSAM or non-VSAM file. Defines a VSAM file, whether its KSDS, ESDS, or RRDS Defines a master catalog Defines a path that relates an alternate index to its base cluster Defines a user catalog. Removes a catalog entry for a catalog, cluster, alternate index or path Produces a transportable file. Copies a previously exported file. MASTER cluster,

Commonly used AMS commands AMS command Functional commands ALTER BLDINDEX DEFINE INDEX LISTCAT REPRO PRINT DEFINE CLUSTER DEFINE CATALOG DEFINE PATH DEFINE USERCATALOG DELETE EXPORT IMPORT

iFrames Technologies

20

Mainframe

VSAM

Modal commands IF SET PARM Controls the flow of command execution by testing condition codes returned by functional commands Controls the flow of command execution by altering condition codes returned by functional commands Sets options values that effect the way AMS executes.

AMS PERFORMANCE PARAMETERS 1) CONTROL INTERVAL SIZE Syntax Abbr Default : CONTROLINTERVALSIZE (bytes) : CISZ or CISIZE : Calculated by VSAM

Control Interval size (CIDF & RDF) & FREESPACE must be taken into account Thumb Rule for CISIZE If the record length is <8192, multiples of 512, >=8192, multiples of 2048 2) FREESPACE Syntax Default : FREESPACE (CI% CA%) : FREESPACE(0 0)

High Free space results in more I/O & consumes larger DASD space Very low FREESPACE results in CI splits and degrades performance Amount of FREESPACE depends on o o o o o o o o o o o o o o //DD1 DD // DSNAME=ANYVSAM1, AMP=('BUFND=4,BUFNI=4,STRNO=2') 3) BUFFERSPACE Syntax Abbr : : BUFFERSPACE (bytes) BUFSP Two data buffers plus one Rate of growth of records Expected number of records to be deleted Reorganization frequency Performance consideration

Default : additional index buffer for KSDS

Used to improve Input/output performance Can also be specific in JCL EXEC parameter

iFrames Technologies

21

Mainframe

VSAM

o o o Strings (STRNO in AMP parameter) o o o Defines number of concurrent access For batch processing, a string of 1 is enough For online processing more strings is required More on VSAM Buffers

Data Buffers (BUFND in AMP parameter) Random Access o Minimum of 2 (One for normal access and one for split processing) is required Sequential Access Ideal to process a track Allocate number of buffers based on the number of CI/TRK For READ add 1 more buffer and for WRITE add 2 more buffers Index Buffers (BUFNI in AMP parameter) Default of 1 index buffer is enough Random Access Ideal to keep the index set in virtual memory Determine the number of levels (using LISTCAT) Allocate number of levels + 1 buffer o o Mutually Exclusive RECOVERY allows you to recover if the job initially loading the dataset fails SPEED is faster, but does not provide restart feature 5) SPANNED Syntax : SPANNED/NONSPAN NED Default : NONSPANNED Default: RECOVERY 4) RECOVERY / SPEED

Allows large records to span more than one Control Interval However, the records cannot span across Control areas RRDS does not support spanned records.

iFrames Technologies

22

Mainframe 11) IMBED 10) VOLUMES Can specify different volumes for Data component Index component 9) REPLICATE 8) REUSE Syntax Default : REUSE/NOREUSE : NOREUSE 7) ORDERED Syntax : ORDERED / UNORDERED Default: UNORDERED 6) KEYRANGES Syntax : KEYRANGES (Low - Val; High - Val) Default Example : ((000001 100000)+ 200000)) 100001 KEYRANGES : None (No range assumed)

VSAM

The Key Ranges correspond to VOLUMES if ORDERED clause is specified.

Goes together with KEYRANGES clause specifies the volume to which the key values should go.

REUSE specifies that the cluster can be loaded with fresh records with an implicit delete of existing RECORDS REUSE cannot be used under following circumstances and hence not recommended When KEYRANGES parameter is coded When alternate indexed are defined

Directs the VSAM to duplicate each index as many times as it will fit on its assigned track Applies only to KSDS index component To reduce rotational delay and to make I/O faster Syntax : Replicate / No replicate Default : No replicate

Directs the VSAM to place the sequence set (the lowest level of index next to the data component) on the first track of the data control area and duplicate it as many times as it will fit. This process will reduce rotational delay because the desired sequence set record is found faster Default: NO IMBED

iFrames Technologies

23

Mainframe INVOKING IDCAMS //MYJOB //STEPA //SYSPRINT //SYSIN JOB EXEC PGM = IDCAMS DD SYSOUT = * DD * DEFINE CLUSTER . . 13) ERASE / NOERASE Default : NOERASE 12) SHARE OPTION Syntax : Note: Syntax : IMBED / NO IMBED

VSAM

IMBED applies to the index component. Hence it is limited to a KSDS. IMBED places the sequence set CI for a data control area within the control area. Uses IMBED only with large control area sizes. IMBED requires additional DASD space. IMBED should provide faster access to data.

SHAREOPTIONS (Cross-region-value Cross-system-Val)

Cross-region : Concurrent data access on a standalone system (ex: TSO&CICS accessing same data) Cross-system : Data access for different computers that are inter-connected) Default : SHAREOPTIONS (1 multiple 3) computers (Two

Multiple jobs can read only if no update takes place - Complete data integrity Multiple jobs can read and at the same time one job can update - Write, but not read integrity Multiple jobs can read & write simultaneously - No integrity Same as option 3, but refreshes buffer after every read Share options 1 & 2 are not allowed for cross-system For cross region sharing, each batch job must have DISP=SHR For cross system sharing DISP parameter in the JCL is immaterial

ERASE instructs VSAM to move zeroes to all the bytes once the cluster is deleted.

IDCAMS commands can be processed as a job or job step (by specifying PGM=IDCAMS) on the EXEC card.

iFrames Technologies

24

Mainframe COMMAND PARAMETERS TERMINATOR BASIC IDCAMS COMMANDS

VSAM

The following are the commands which will be used with IDCAMS procedure. BUILDINDEX DEFINE IMPORT/EXPORT LISTCAT REPRO VERIFY AMS COMMAND SYNTAX

SERVICEFURTHER REQUESTED Data Set Name Data Set Type Space Allocation Where? How much? Data Set Attributes Margins Separators Comments Terminator

END OF COMMAND DESCRIBES COMMAND

Default to 2&72 BLANK,COMMA /*----------------*/ SEMICOLON or Absence of Continuation mark

Continuation HYPEN, PLUS SIGN There are two possible continuation characters: The PLUS sign (+): ignores the leading blanks on the next line. The HYPEN sign (-): doesnt ignore the leading blanks on the next line. DEFINE SPECIFICATONS

When defining a VSAM cluster using the DEFINE CLUSTER command, the following must or can be specified.

iFrames Technologies

25

Mainframe secondary) ] ) ] [ INDEX ( [ NAME( entry name) ] [ VOLUMES ( Vol ser .)] secondary) ] ) ] secondary)}] [ UNIQUE | SUBALLOCATION] [ REUSE | NOUSE] [ SHAREOPTIONS ( a b)] [ IMBED | NOIMBED] [ STORAGECLASS(storage class)] [ DATACLASS(data-class)] [MANAGEMENTCLASS (management- class)] [ DATA ( [ NAME (entry name) ] [ VOLUMES (vol ser .)] [ FILE (ddname) ] The data set attributes: Record size and control interval size. For a KSDS: Key information and free space distribution. BASIC DEFINE COMMAND SYNTAX FOR CLUSTER: The DEFINE CLUSTER Command DEFINE CLUSTER ( NAME(entry name) [ OWNER(owner id) ] [ FOR(days) | TO(date) ] [ INDEXED | NONINDEXED | NUMBERED ] [ RECORDSIZE (avg max) ] [ CISZ(size)] [ SPANNED | NONSPANNED] [ KEYS (length offset)] [ FREESPACE ( ci ca) ] [ VOLUMES ( vol-ser no..)] [ FILE (ddname) ] The data set name: The cluster name is required. Component name(s) is/are optional. The type of the date set type: KSDS, ESDS, RRDS, LDS.

VSAM

[ { cylinders /kilobytes/megabytes/tracks/records} (primary

[ { cylinders/kilobytes/megabytes/tracks/ records} (primary

[ { cylinders/kilobytes/megabytes/tracks/ records} (primary

iFrames Technologies

26

Mainframe Explanation NAME (entry name) component OWNER (owner id) FOR (days) dddd) yyddd) TO (date) [CATALOG ( name [/ password]) ]

VSAM

Specifies the name of the cluster or Specifies a 1 to 8 character owner-id. Specifies a retention period ( in the format or an expiration date (in the format Specifies the file organization: SDS

INDEXED / NONINDEXED/NUMBERED

INDEXED), SDS NONINDEXED), OR RRDS NUMBERED). The default is INDEXED. RECORDSIZE ( avg max) record size. CISZ (Size) SPANNED / NONSPANNED control default is NONSPANNED. KEYS (length offset) primary FREESPACE (ci ca) reserve control areas. VOLUMES (Vol-ser) contain FILE (dd name) volumes .Required DASD volumes. Primary allocate, kilobytes, records. Secondary UNIQUE/SUBALLOCATION SUBALLOCATION. REUSE / NOREUSE default is SHAREOPTIONS ( a b) permitted. IMBED / NOIMBED should be a KSDS. The Specifies the average and maximum

Specifies the size of the control intervals. Specifies whether records can cross interval boundaries. The

Specifies the length and offset of the key. specifies the percentage of free space to in the control intervals and Specifies one or more volumes that will the cluster or component. Specifies a dd name that identifies a DD statement that allocates the only for mountable Specifies the amount of space to initially expressed in terms of cylinders, megabytes, tracks or Specifies the secondary space allocation. Specifies whether the file is unique or sub allocated. The default is Specifies whether a file is reusable. The NOREUSE. Specifies the level of the file sharing Specifies whether sequence set records imbedded in the data component of default is NOIMBED.

iFrames Technologies

27

Mainframe

VSAM

CATLOG (name[/password]) Specifies the name and password of the catalog that will own the cluster. If omitted, the highlevel qualifier of the cluster name or the stepcat, jobcat, or master catalog identifies the catalog. NAME is a positional keyword parameter and must be coded first. Other keywords can be placed anywhere EXAMPLES OF THE DEFINE CLUSTER: Example #1 Define a key-sequenced data set (KSDS) DEFINE CLUSTER ( NAME (MTRG.CUSTOMER.MASTER) OWNER(MTRG) INDEXED RECORDSIZE(80 80) KEYS(6 0) VOLUMES(SMS007) UNIQUE SHAREOPTIONS( 2 3) IMBED) DATA ( NAME(MTRG.CUSTOMER.MASTER.DATA) CYLINDERS(50 5) CISZ(4096) ) INDEX ( NAME(MTRG.CUSTOMER.MASTER.INDEX)) Example #2 Define an entry-sequenced data set (ESDS) DEFINE CLUSTER (NAME (MTRG.CUSTOMER.MASTER) OWNER (MTRG) NONINDEXED RECORDSIZE (180 80) VOLUMES (SMS007) REUSE) DATA -

Example #3

( NAME (MTRG.CUSTOMER.MASTER.DATA) CYLINDERS (50 5) )

Define an relative-record data set (RRDS) DEFINE CLUSTER (NAME (MTRG.CUSTOMER.MASTER) OWNER (MTRG) NUMBERED -

iFrames Technologies

28

Mainframe // DD statement with new parameters and/or info from DATA CLASS CHAPTER - 5: Creation of Clusters REVIEW QUESTIONS: 1. What is IDCAMS? And what is the purpose of it? 2. What is the significance of the SHAREOPTIONS parameter? 3. What is the use of REPRO command? 4. What are the different types of AMS commands? 5. What are the basic IDCAMS commands? 6. AMS will generate a data component name if it is not explicitly coded. a) b) TRUE FALSE DATA (NAME (MTRG.CUSTOMER.MASTER.DATA) CYLINDERS (50 5) ) RECORDSIZE (180 80) VOLUMES (SMS007) UNIQUE) -

VSAM

7. What are the parameters used in AMS commands? 8. Can AMS commands be run from the TSO prompt? 9. What is the base cluster?

CREATION OF VSAM DATA SETS THROUGH JCL

A Data Class is a description of data set characteristics under control of SMS. JCL parameter overrides the specifications from a Data Class. VSAM accomplishes JCL simplification by centralizing functions such as defining,

iFrames Technologies

29

Mainframe

VSAM

deleting, and altering file characteristics in the AMS Utility program. VSAM has much simpler JCL requirements than files of other access methods. Explanation: DSNAME level DUMMY should Specifies the name of the VSAM dataset. Normally, the high qualifier of the name identifies the owning catalog. Specifies that a VSAM file should not be allocated; instead, MVS simulate a VSAM FILE. //ddname dd DSNAME={data-set-name} {Dummy}[,Disp={old/shr},Normal-disp,Abnormal-disp] [,AMP=(option,option.)] How to create VSAM files using JCL. The DD statement for allocating existing VSAM File How to allocate existing VSAM files The DSNAME parameter The DUMMY parameter The DISP parameter The AMP Parameter

DISP Specifies the files status and, the files normal & abnormal disposition. The valid status options are OLD for exclusive access and SHR for shared access. All of the disposition options except UNCATLG are valid for VSAM files. AMP Specifies one or more processing options for VSAM files.

The AMP parameter The AMP parameter is for VSAM files & the DCB parameter is for nonVSAM files. It specifies execution time information that affects how the file is processed. The AMORG sub parameter AMORG indicates that the files being accessed is a VSAM file. Normally, MVS realizes that a VSAM file is being processed when it retrieves the catalog information for the file. So we need to specify AMP=AMORG when MVS doesnt search the catalog. The AMP parameter AMP=[ AMPORG] [,BUFND=n] [,BUFNI=n] [,BUFSP=n]

iFrames Technologies

30

Mainframe [,OPTCD=OPTIONS] [,RECFM=FORMAT] [,STRNO=N] Explanation AMORG required. BUFND component. BUFNI component. BUFSP data

VSAM

Specifies that the data set is a VSAM file. Normally not Specifies the number of buffers to allocate for the data Specifies the number of buffers to allocate for the index Specifies the total amount of space in bytes to allocate for the and index buffers.

OPTCD options for the ISAM interface. Code I , L, or IL. I means that if OPTCD=L is specified for the file in the processing program, records marked for deletion by hex FF in the first byte should be physically deleted from the file. If OPTCD=L is not specified in the program, Specify OPTCD=IL in the DD statement for the same effect. RECFM process STRNO issue Example #1 //CUSTMAST DD DSNAME=MTRG.CUSTOMER.MASTER, DISP=SHR, // AMP=(BUFND=2,BUFNI=6) Specifies the format in which the ISAM program expects to records. Specifies the number of concurrent requests the program may against the file.

Allocate a VSAM file for shared access, specifying that 2 data buffers and 6 index buffers should be used. Example # 2 //CUSTISAM DD DSNAME=MTRG.CUSTOMER.MASTER,DISP=SHR, // AMP=(AMORG,OPTCD=IL,RECFM=FB)

Allocate VSAM file using the ISAM interface program, AMORG identifies the file as VSAM, OPTCD specifies how logically deleted records should be handled and RECFM specifies that the program expects fixed-length blocked records. NEW PARAMETER USED IN VSAM

KEYOFF = offset-to-key RECORG =

ES KS RR LS

iFrames Technologies

31

Mainframe RECORG parameter o o o o o o KSDS (EX1) o KSDS //DD1 DD DSNAME = MY.KSDATA, o // DISP=(NEW,CATLG), o o o o o o o o ESDS (EX2) // // // // // // SPACE=(400,(50,5)), AVGREC=K, RECORG =KS KEYLEN= 15, KEYOFF=0, LRECL=250 KS ES RR LS specifies a VSAM key-sequenced data set specifies a VSAM entry-sequenced data set specifies a VSAM relative record data set. specify a VSAM linear space data set. KEYLEN =Bytes (for KSDS and some non-VSAM data sets) (for KSDS Only)

VSAM

// DD2 DD DSNAME=MY.ESDATA o // DISP=(NEW,CATLG), o // SPACE=(100,(10,8)), // RECORG =ES o // LRECL=50 o o o RRDS (EX3) o LINEAR //DD3 DD DSNAME=&LIN, o // DISP=(NEW,PASS), o o o o o Not all VSAM options can be specified in the JCL, more options and defaults may come from a Data class. // // // SPACE=(1,(10)), AVGREC=M, RECORG=LS

EX1 shows a JCL statement containing all required information for a KSDS data set.

iFrames Technologies

32

Mainframe /* // //IFMAIN2 JOB (12345678),IFMAIN2,MSGCLASS=H, // MSGLEVEL=(1,1),CLASS=A,NOTIFY=&SYSUID EXEC PGM=IDCAMS DD SYSOUT=* DD * //STEP1 //SYSOUT //SYSIN CREATION OF ESDS CLUSTER above. REPRO Command REPRO is an all-purpose load and backup utility command .

VSAM

Ex2 shows a JCL statement containing all required information for an ESDS data set. Ex 3 shows a JCL statement of a temporary linear data set. This example requires the assignment of a so-called storage Class.

It loads an empty VSAM cluster with records. The data and index components (for a KSDS) are build automatically. It creates a backup of a VSAM dataset on a physical sequential dataset, and then restore and rebuilds the VSAM dataset using this dataset as input It merges data from two VSAM datasets. REPRO terminates if One physical I/O error while writing to the output dataset. A total of four errors encountered in any combination: A logical error while writing to the output data set. A logical error while reading the input data set. A physical error while reading the input data set.

The definition of an ESDS cluster with the parameters described

//SYSPRINT DD SYSOUT=* DEFINE CLUSTER RECORDSIZE (80,80) TRACKS(5, 1) CISZ(4096) NONINDEXED REUSE) DATA (NAME(IFMAIN2.IFRAME.CLUST.DATA))

(NAME (IFMAIN2.esds.CLUST)

iFrames Technologies

33

Mainframe

VSAM

The above example shows the creation of an ESDS cluster. After the execution of this JCL the blank cluster will be created and it will be in the user catalog for usability. COPYING ENTIRE DATA SETS The following screen shot will copy the EMP1.PS content to the above created ESDS cluster, KSDS In this example, an entire input data set is copied to the output data set. Two parameters of REPRO are used. INDATASET (or IDS) Name of the entry to be copied or of the user catalog to be merged. OUTDATASET (or ODS) Name of the target data set. Both INDATASET and OUTDATASET can be used to reference VSAM or nonVSAM data sets. Example: //IFMAIN2 JOB //STEP1 NOTIFY=&SYSUID

EXEC PGM=IDCAMS SYSOUT=*

//SYSPRINT DD

//SYSOUT DD SYSOUT=* //DD1 DD DSN=IFMAIN2.EMP1.PS,DISP=SHR //DD2 DD DSN=IFMAIN2.ESDS.CLUSTER,DISP=SHR //SYSIN DD * REPRO INDATASET(IFMAIN2.EMP1.PS) OUTDATASET(IFMAIN2.ESDS.CLUSTER) /* // CREATION OF KSDS CLUSTER WITH REUSE OPTION. REUSE specifies that the cluster can be loaded with fresh records with an implicit delete of existing records. The REUSE parameter can be specified on both the DEFINE CLUSTER and the REPRO command. Example: //ifmain2 job notify=&sysuid //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //SYSIN DD * DEFINE CLUSTER(NAME(IFMAIN2.KSDS.CLUSTER)TRACKS(2,5)RECORDSIZE(80,80)-

iFrames Technologies

Here the KSDS cluster 34 is created with REUSE option

Mainframe CONTROLINTERVALSIZE(512)FREESPACE(20,20)KEYS(4,0)REUSEINDEXED))DATA(NAME(IFMAIN2.KSDS.DATA))INDEXED(NAME(IFMAIN2.KSDS.INDEX)) /* //

VSAM

REUSE cannot be used under following circumstances and hence not recommended When KEYRANGES parameter is coded When alternate indexed are defined CREATION OF RRDS CLUSTER The following screenshot shows the definition of an KSDS cluster with the parameters described above Example:


KSDS

//IFMAIN2 JOB NOTIFY=&SYSUID //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //SYSIN DD * DEFINE CLUSTER(NAME(IFMAIN2.RRDS.CLUSTER)TRACKS(2,5)RECORDSIZE(80,80)CONTROLINTERVALSIZE(512)NUMBERED))DATA(NAME(IFMAIN2.RRDS.DATA)) /* //
REPRO RECORD SELECTION DATA set can be copied partially using starting and ending delimiter parameters on the REPRO command number = Number of records key-value = Record key for a KSDS rba = relative byte address for a record in a KSDS or ESDS rrn = Relative record number(slot) for RRDS records to stop Where to start Where

FROMKEY (rec-key)

TOKEY (rec-key)

iFrames Technologies

Here thEMP1.PS is entirely copied to ESDS.CLUSTER

35

Mainframe The Following The Selection Of Records In Different VSAM Files. ESDS CLUSTER //IFMAIN2 JOB NOTIFY=&SYSUID //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //INPUT DD DSN=IFMAIN2.ESDS.CLUSTER,DISP=SHR //SYSIN DD * PRINTINFILE(INPUT)CHARFROMADDRESS(0)TOADDRESS(160) /* // KSDS, ESDS RRDS, ISAM SKIP(number) RRDS FROMNUMBER (rrn) KSDS, ESDS FROMADDRESS(rba)

VSAM

TOADDRESS(rba) TONUMBER (rrn) COUNT(number)

The above program will display only the selected RBA address records which are shown by the following screenshots. KSDS CLUSTER The following use the keys to select the particular records from the kSDS cluster Example: //IFMAIN2 JOB NOTIFY=&SYSUID //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //INPUT DD DSN=IFMAIN2.KSDS.CLUSTER,DISP=SHR //SYSIN DD * PRINT-

iFrames Technologies

36

Mainframe INFILE(INPUT)CHARFROMKEY(1000)TOKEY(1004) /* // RRDS CLUSTER

VSAM

The following screen shots use the keys to select the particular records from the kSDS cluster //IFMAIN2 JOB NOTIFY=&SYSUID //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //INPUT DD DSN=IFMAIN2.RRDS.CLUSTER,DISP=SHR //SYSIN DD * PRINTINFILE(INPUT)CHARFROMNUMBERED(1000)TONUMBERED(1004) /* // REVIEW QUESTIONS: 1. Which of the following repro selection parameters can be specified for an LDS? a) c) From key From number b) d) from address skip e) none of the above.

2. REPRO will stop processing records when a total of four physical I/O errors occur while writing to the output data set.

A. TRUE B. FALSE C. D. 3. REPRO REUSE against a non-empty target data set with NOREUSE will reset target data set. A. TRUE B. FALSE C. D. 4. AMS will generate a data component name if it is not explicitly coded.

iFrames Technologies

37

Mainframe A. TRUE B. FALSE C.

VSAM

D. 5. When defining a KSDS, which of the following parameters is not required? E. A. Space allocation (either CYL, REC or TRK) B. VOLUMES C. KEYS D. NAME E. F. 6. DEFINE CLUSTER for a KSDS will generate CLUSTER, DATA and INDEX information even if only CLUSTER information is specified. A. TRUE B. FALSE C. D. 7. A candidate volume is not used when the data set is initially loaded. A. TRUE B. FALSE C. D. 8. If the key of a KSDS record begins in the second field (first field is 25 bytes long), the offset in the KEYS parameter is: E. F. a) 24 G. H. 9. Suppose TEST.DATASET is a KSDS. The following statement will print CLUSTER information only: LISTCAT ENTRIES (TEST.DATASET) ALL a. TRUE b. FALSE. c. d. e. f. g. h. i. j. k. l. m. n. o. b) 25 c) 26 d) None of the above.

iFrames Technologies

38

Mainframe p. q. r. CHAPTER --- 6 : Print and Additional Commands s. t. PRINT COMMAND u.

VSAM

The PRINT command of Access Method Services is used to print the contents of both VSAM and non-VSAM data sets. The command syntax is similar to that of REPRO. While REPRO copies an input data set into another output data set, PRINT dumps an input data set to a printer. This command is versatile and can be used to print a complete data set or only a selected part of it.

v. w. The PRINT command x. y. z. aa. PRINT { INDATASET(entry-name [/ password])} [{CHARACTER/HEX/DUMP}] [{SKIP(count)/ FROMKEY(key)/FROMNUMBER(number)/FROMADDRESS(address)}] bb. [{COUNT(count)/TOKEY(key)/TONUMBER(number)/TOADDRESS(addre ss)] cc. dd. Explanation ee. CHARACTER/HEX/DUMP -Specifies the format of the output. CHARACTER & HEX print the data in character or hex format. DUMP prints data in both character and hex format. DUMP is default.

ff. gg. Example hh. To print records 29, 30 & 31 in character format. ii. jj. kk. ll. mm. nn. To print records 29,30 & 31 in dump format. oo. pp. qq. rr. ss. tt. Example: PRINT INDATASET (MTRG.CUSTOMER.MASTER) DUMP SKIP(28) COUNT(3) PRINT INDATASET(MTRG.CUSTOMER.MASTER) CHARACTER SKIP(28) COUNT(3) -

uu.

//ifmain2 job notify=&sysuid

iFrames Technologies

39

Mainframe

VSAM

vv. ww. xx. yy. zz.


aaa. bbb. ccc.

//step1 exec pgm=idcams //sysprint dd sysout=* //sysout dd sysout=* //input dd dsn=ifmain2.rrds.cluster,disp=shr //sysin dd * PrintInfile(input)CharSkip(1)Count(3) /* //

ddd.
eee.

fff.
ggg. hhh.

iii. EXPORT/IMPORT COMMAND jjj. Export extracts catalog information and creates a copy of the data records. When a base cluster and its alternate index are permanently exported, the alternate index must be exported before the base cluster. When exporting a data set for backup purpose specify TEMPORARY to preserve the original data set. IMPORT

kkk. lll. EXPORT

mmm. nnn. Advantages Used for backup and recovery Catalog information also exported along with the data, unlike REPRO DFSMS classes are preserved

iFrames Technologies

40

Mainframe Cluster deletion and redefinition are not necessary during the import Can be easily ported to other systems Disadvantages The EXPORTED file not reusable until it is imported Slower than REPRO

VSAM

Catalog

Data set

EXPORT

CIMODE default for TEMPORARY PERMANENTRECORD MODE TIME. RECORDS ARE EXPORTED ONE LOGICAL RECORD AT A RECORDMODE is the default for ESDS, KSDS, and RRDS. CI rather than logical record exports data. CIMOD is LDS. The data set is not deleted after export. The data set is deleted after export. SYNTAX FOR EXPORT EXPORT entryname[/password] [CIMODE | RECORDMODE] {outfile(ddname) outdataset(entryname)} [TEMPORARY | PERMANENT] [INHIBITSOURCE NOINHIBITSOURCE] [INHIBITTARGET |NOINHIBITTARGET] [ERASE | NOERASE] [PURGE | NOPURGE] -

iFrames Technologies

41

Mainframe INHIBITSOURCE INHIBITTARGET ERASE when it NOERASE was created. Example: The original data set becomes read-only. The copy data set becomes read-only.

VSAM

NOINHIBITSOURCE - The original data can be updated. NOINHIBITTARGET - The target data set can be updated. Causes the exported item to be overwritten with zeros is deleted. Override whatever was specified for the item when it

//IFMAIN2 JOB NOTIFY=&SYSUID //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //DD1 DD DSN=IFMAIN2.BACKUP.PS, // DISP=(NEW,CATLG,DELETE), // UNIT=SYSDA, // SPACE=(TRK,(2,3),RLSE), // DCB=(LRECL=80,RECFM=FB,BLKSIZE=800,DSORG=PS) //SYSIN DD * EXPORTIFMAIN2.KSDS.CLUSTEROUTFILE(DD1) /* // Now the above exported file is not available in user catalog. It is permanently exported to the new PS which is created. To get back the exported cluster we want to use import option to get back it in our user catalog. This is illustrated in the following snapshots. SYNTAX OF IMPORT IMPORT{INFILE(DDNAME) | INDATASET(ENTERYNAME)} {OUTFILE(DDNAME) | UTDATASET(ENTERYNAME)} [OBJECTS((ENTERYNAME - [NEWNAME(NAME)] VOLUMES(VOLSER])[ENTRYNAME.)])] [INTOEMPTY] NEWNAME VOLUMES omitted volume INTOEMPTY Objects beginning imported can be renamed. Specifies the volume on which the cluster is to reside if the original volume is the receiving Indicates that the receiving dataset is empty.

iFrames Technologies

42

Mainframe

VSAM

On IMPORT the existing catalog entry is deleted unless the receiving data set is empty.

IMPORT

Catalog

Data set

The following procedure provides backup and recovery capabilities and also permits the modification of data set attributes when the data set is imported during recovery or reorganization.

iFrames Technologies

43

Mainframe

VSAM

STEP 1 EXPORT

STEP 4 IMPORT INTOEMPTY

ORIGINAL MASTER

STEP 2 DELETE

STEP 3 DEFINE

NEW MASTER

Example: //IFMAIN2 JOB NOTIFY=&SYSUID //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //DD1 DD DSN=IFMAIN2.BACKUP.PS, //SYSIN DD * IMPORTINFLIE(DD)OUTDATASET(IFMAIN2.KSDS.CLUSTER) /* // VERIFY COMMAND Verifies the catalog HURBA (High Used Relative Byte Address) field and stores the true values from the control block HURBA field. It should be used against cluster name only and not against data or index components. It is used to rectify some of the problems due to data corruption It can be issued from TSO or from a JCL

Syntax:

VERIFY FILE (<dd name>)

iFrames Technologies

44

Mainframe VERIFY DATASET (<dataset name>)

VSAM

END-OF-DATA TEST.DATA.SET END-OF-KEY-RANGE

END-OF-DATA END-OF-KEYRANGE

Example: //IFMAIN2 JOB NOTIFY=&SYSUID //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //SYSIN DD * VERIFY DATASET(IFMAIN2.KSDS.CLUSTER) /* // LISTCAT LISTCAT Command identify the catalog, the names of the entries to be listed, the types of entries to be listed, and the amount of information about each entry to be listed. LISTCAT [ [LEVEL CATALOG (name) ] (name - of - entries) ] (generic-level-names)] Compares Catalog Information with the Data Set Corrects Catalog If A Disagreement Is Found Run VERIFY after a system failure. When sharing data sets, run VERIFY before opening a data set. VERIFY cannot be used for an empty data set or an LDS.

[ ENTRIES

[ NAME/HISTORY/VOLUME/ALLOCATION/ALL}]

iFrames Technologies

45

Mainframe Catalog(name[/password]) password of entries are to be listed. Specifies the name and the catalog

VSAM if, required, from which

ENTRIES(entry-name[/password]) Specifies the names of the entries you want to list. If omitted, all entries in the specified catalog are listed. LEVEL(level) qualifications. Any matches those levels are Specifies one or more levels of data sets whose name listed.

Entry type Specifies the type of entries you want listed. If both ENTRIES / LEVEL and entry-type are omitted, all entries of all types in the specified catalog are listed. Code one of these values: ALIAS, CLUSTER, DATA, INDEX, & PATH NAME the Name is the HISTORY NAME, (such as creation and to be listed. VOLUME HISTORY, the specified entries, ALLOCATION VOLUME, information, is to be listed. ALL information for listed. Examples To list the catalog MTRG.CUSTOMER.MASTER entry for a VSAM file named Specifies that only the names and types of specified entries are to be listed. default. Specifies that the information listed by Plus the history information expiration dates) is Specifies that the information listed by plus the volume locations of is to be listed. Specifies that the information listed by plus detailed extent Specifies that all available catalog the specified entries is to be

ENTRIES (MTRG.CUSTOMER.MASTER) To list information for more than one file, just code several file names in a single ENTRIES parameter, like this: ENTRIES (MTRG.CUSTOMER.MASTER MTRG.SUPPLIER.MASTER MTRG.ITEM.TRANS) We can specify a generic entry name by replacing one or more levels of the file name with an asterisk. ENTRIES (MTRG.*.MASTER) All files whose names consists of three levels with MTRG as the first level and MASTER as the third level, are listed. MTRG.CUSTOMER.MASTER AND MTRG.SUPPLIER.MASTER meet these criteria, so they would be listed. -

iFrames Technologies

46

Mainframe Example: //IFMAIN2 JOB NOTIFY=&SYSUID //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //SYSIN DD * LISTCAT ENTRIES(IFMAIN2.VSAM.PDS) LISTCAT ENTRIES(IFMAIN2.VSAM.*) /* // ALTER

VSAM

We can use this powerful command to change certain attributes of previously defined VSAM object. These objects include base cluster and its data and index component and even alternate index cluster and its data or index component and even a VSAM or ICF catalog. If you are properly authorized you can ALTER NON-VSAM data set attributes also.

CATALOG EXAMPLE.KSDS SHAREOPTIONS(1 3)


Examples:

CATALOG ALTER EXAMPLE.KSDS SHAREOPTIONS(2 3) EXAMPLE.KSDS SHAREOPTIONS(2 3)

SYNTAX OF ALTER COMMAND ALTER entryname[/password] -

SHAREOPTION(cross region cross system) ALTER MTRG.CUSTOMER.MASTER NEWNAME(MTRG.CUSTMAST) ALTER EMPLOYEE.KSDS.CLUSTER FREESPACE(25,25) Change the filename of MTRG.CUSTOMER.MASTER to MTRG.CUSTMAST

iFrames Technologies

47

Mainframe ALTER MTRG.CUSTOMER.MASTER.DATA ADDVOLUMES(VOL291 VOL292) REMOVEVOLUMES(VOL 281 VOL 282) -

VSAM

Add VOL291 and VOL292 to list of eligible volumes MTRG.CUSTOMER.MASTER.DATA and remove VOL281 and VOL282. Example: //IFMAIN2 JOB NOTIFY=&SYSUID //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //SYSIN DD * ALTER IFMAIN2.KSDS.DATA NEWNAME(IFMAIN2.VSAM.KSDS) /* // Likewise we can alter the other data attributes like: ADDVOLUME ATTEMPTS SHAREOPTIONS BUFFERSPACE FREESPACE PASSWORD ENTRY NAME is the cluster, data or index component name.

for

PASSWORD is the master password if the VSAM data set is password protected ALTER can also be used as a migration path to change an ESDS to LDS

ALTER with ADDVOLUME/REMOVEVOLUME ADD VOLUME: //ALTJOB //STEP1 //SYSPRINT //SYSIN ALTER JOB DD DD ,,NOTIFY=userid SYSOUT=* * EXEC PGM=IDCAMS

USER1.KSDS.DATA ADDVOLUMES(VS012)

iFrames Technologies

48

Mainframe DELETE COMMAND ALTERING PASSWORD Adding/Changing PASSWORD ALTER entryname[/password] [READPW (password)] Entryname must be the name of the clusters data component. This procedure has the following advantages. It prevents wasting space. It minimizes CI and CA splits. Example: //ALTJOB //STEP1 //SYSPRINT //SYSIN ALTER USER1.KSDS.DATA FREESPACE(30 30) JOB DD DD . SYSOUT=* * EXEC PGM=IDCAMS ALTER WITH FREESPACE ALTER entryname[/password] FREESPACE(CI-percent[ CA-percent])) REMOVE VOLUME: ALTER USER1.KSDS.DATA REMOVEVOLUME(RTD2) -

VSAM

[UPDATEPW (password)] [CONTROLPW (password)][MASTERPW (password)] Nullifying PASSWORD ALTER entryname[/password] NULLIFY [READPW] [UPDATEPW] [CONTROLPW] [MASTERPW ] -

iFrames Technologies

49

Mainframe

VSAM

DELETE command is used to remove entries from a VSAM catalog. To delete more than one file, list the names in parentheses. The IDCAMS DELETE command can be used to delete both VSAM and non-VSAM objects SYNTAX: DELETE entry name/password Example 1 We can specify a generic name in a DELETE command by replacing ONE level of the entry name with an asterisk, like this DELETE MTRG.CUSTOMER.* Example 2 To delete MTRG.CUSTOMER.MASTER, whether or not it is expired. DELETE MTRG.CUSTOMER.MASTER PURGE Example 3 To delete the 3 named files. DELETE ( MTRG.CUSTOMER.MASTER MTRG.CUSTMAST.AIX MTRG.CUSTMAST.PATH) Example: //IFMAIN2 JOB NOTIFY=&SYSUID //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //SYSIN DD * DELETE IFMAIN2.KSDS.CLUSTER /* // Some other options for Delete are: ALIAS ALTERNATEIND CLUSTER SPACE PURGE PATH REVIEW QUESTIONS: 1. The default print format is: a. character b. dump c. hexadecimal d. none of the above. e. 2. Which of the following repro selection parameters can be specified for an LDS? -

A.

from key

iFrames Technologies

50

Mainframe B. C. D. E. from address from number skip none of the above F. 3. The replace parameter causes:

VSAM

a. KSDS records to be replaced by an input record with the same key b. ESDS records to be replaced by an input record with the same RBA c. RRDS records to be replaced by an input record with the same RRN d. a) and c) e. all of the above f. A. B. TRUE FALSE C. 5. REPRO will stop processing records when a total of four physical I/O errors occur while writing to the output data set. A. B. TRUE FALSE C. 6. Which of the following is not a valid command? a. IF b. THEN c. ELSE d. DO e. GOTO f. A. B. TRUE FALSE C. 8. Can VSAM files be deleted with the DELETE option of the DISPOSITION parameter of JCL? D. 9. During processing of a VSAM file, some system error occurs and it is subsequently unusable What do you do? E. F. G. CHAPTER --- 7 : Alternate Indexes H. An alternate index is used to an access the records of a VSAM key-sequenced data set in an order other than the files primary key (or base key). The data set over which an alternate index exists is called a base cluster. Even we can use an entry-sequenced data set as the base cluster for an alternate index, most alternate indexes are built over KSDS clusters. Used whenever the data is required to be retrieved 7. REPRO REUSE against a non-empty target data set with NOREUSE will reset the target data set. 4. Generic keys can be specified in PRINT FROM KEY and TOKEY

iFrames Technologies

51

Mainframe

VSAM on the basis of other field (than primary key field). alternate index cannot be defined for RRDS or LDS I. J. An

ALTERNATE INDEX 1 (DEPT NO)

ALTERNATE INDEX 2 (SOCIAL SEC NO)

BASE CLUSTER (NAME)

015-35-7890 WRIG 183-96-416 ADAM 234-04-2372 PETT

3235 NEWTON $ 3240 WRIGHT $.. 3247 ADAMS $.. 3247 PETTY $

ADAMS 3247 $ ARNOLD 4711 $ KINNEY 3247 $ NEWTON 3235 $..

K. MULTIPLE ALTERNATE INDEXES (AIXs) may be defined over a base cluster. L. If the user is sequentially retrieving records using AIX1, then department number retrieves records in logical sequence Access via AIX2 with an alternate key of social security number results in the retrieval of base cluster records in social security number sequence.

M. ADVANTAGES Can be defined for both KSDS & ESDS 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

iFrames Technologies

52

Mainframe NEED FOR ALTERNATE INDEX:

VSAM

Alternate Indexes save sorting or maintaining duplicate data that might otherwise be required.An alternate index cannot be defined for an RRDS or LDS KSDS

A. ACCESS A KSDS BY KEY OTHER THAN THE PRIMARY KEY 1. SOCIAL SECURITY NUMBER 2. DEPARTMENT NUMBER 3. EMPLOYEE NUMBER 4. ZIP CODE 5. B. ACCESS AN ESDS BY KEY 6. 7. ALTERNATE INDEX DATA RECORD FORMAT 8. 9. 10.
RECORD SIZE PRIME KEY LENGTH * NUMBER NONUNIQUE PRIME KEYS -0R4 *NUMBER NONUNIQUE POINTERS

INDEX: EMPLOYEE NAME DATA: EMPLOYEE RECORDS

11. + ALTERNATE KEY + =5 12. LENGTH 13. 14. 15. 16. 17. 18.
POINTERS

Each AIX data record is variable length and contains system header information, the alternate key and at least one pointer to the

iFrames Technologies

53

Mainframe

VSAM base cluster. AIX s are spanned record data sets, since there may be many base cluster records associated with a given alternate key. 19. Pointers to the base cluster are of two forms, either an RBA (for an ESDS base cluster)or a prime key for a ksds base cluster).The pointers are the same type throughout the entire AIX.

20. 21.ALTERNATE INDEX ORGANIZATION Alternate Indexes are KSDS by themselves and have their own data and index components RELATE Syntax: RELATE (base cluster name) VOLUMES Syntax: Volumes (Vol-ser-1 ..... vol-ser-n) Required parameter: Assigning base cluster & AIX in different volumes improves performance NAME Syntax: NAME Required parameter: Specifies the name of AIX CREATING AN ALTERNATE INDEX DEFINE ALTERNATEINDEX(NAME(AIX NAME)RELATE(BASE CLUSTER NAME)KEYS (LENGTH OFFSET)UNIQUEKEY/NONUNIQUEKEYUPGRADE/ NOUPGRADE RECORDSIZE (AVG MAX)VOL (VOLSER) CYL/TRK/REC(PRI SEC)) STEPS FOR CREATING ALTERNATE INDEX Define AIX using IDCAMS DEFINE AIX Build AIX & populate it using IDCAMS BLDINDEX Specify Alternate Index Path using IDCAMS DEFINE PATH AIX data components contain the alternate index key values and pointers to each record containing the key value AIX index components contain highest key value in an AIX data CI and a pointer to that CI AIX data component has variable length records if duplicate is allowed (due to multiple pointers)

iFrames Technologies

54

Mainframe UPGRADE/NOUPGRADE Syntax: UPGRADE/NOUPGRADE

VSAM

Required parameter: Establishes relationship between the base cluster & AIX

UPGRADE specifies that records in AIX are to be updated automatically whenever the base cluster is updated .The use of UPGRADE makes the alternate index part of the clusters so called UPGRADE SET Default: UPGRADE

KEYS

AIX 1 AIX 2 AIX 3

Base cluster

Syntax: KEYS (length offset) Optional: primary key values are taken as default, if not specified.Defeats the purpose of Alternate Index, if not specified RECORD SIZE Syntax: RECORD SIZE (average maximum) Default: RECORDSIZE (4086 32600) Abbr: RECSZ Average & max. Are same for UNIQUEKEY AIX and may be different for NONUNIQUEKEY

HOW TO CALCULATE THE RECORD SIZE?

iFrames Technologies

55

Mainframe Other AIX parameter ATTEMPTS AUTH (entry point) BUFFERSPACE (bytes) CATALOG (catalog/pw) CODE (code) CISZ (bytes) CONTROLPW (password) ERASE (NOERASE) EXCEPTIONEXIT (entry point) KEYRANGES (low-key high key) MASTERPW (password) ORDERED/UNORDERED READPW (password) REPLICATE/NOREPLICATE REUSE/NOREUSE SHAREP[TOPMS SPEED/RECOVERY UNIQUEKEY/NONUNIQUEKEY UPDATEPW (password) WRITECHECK/NOWRITECHECK EXAMPLE: //STEP1 //SYSIN EXEC DD * PGM =IDCAMS SYSOUT = * //SYSPRINT DD same AIX for a KSDS RECSZ = 5 + AIXKL + (n x BCKL) AIX for ESDS RECSZ = 5 + AIXKL + (n x 4) Where: AIXKL is the alternate-key length BCKL is the base cluster's prime-key length n = 1 when UNIQUEKEY is specified

VSAM

n = the number of data records in the base cluster that contain the alternate-key value, when NONUNIQUEKEY is specified.

DEFINE ALTERNATEINDEX(USER1.KSDS.AIX)VOLUME(V001) UPGRADECYLINDERS(2 1)KEYS(25 9)RELATE(USER1.KSDS.CLUSTER)-

iFrames Technologies

56

Mainframe BUILD INDEX SYNTAX: BLDINDEX {INFILE(ddname) / INDATASET (base cluster name)} {OUTFILE(ddname) / OUTDATASET (AIX NAME)} [EXTERNALSORT / INTERNALSORT] ddname) ] [WORKFILES(ddname RECORDSIZE(70 110)FREESPACE(20 10)NONUNIQUEKEYDATA (NAME(USER1.KSDS.AIX.DATA))INDEX (NAME(USER1.KSDS.AIX.INDEX))

VSAM

INFILE /INDATASET IDENTIFIES THE BASE CLUSTER. OUTFILE / OUTDATASET IDENTIFIES THE AIX TO BE LOADED INTERNALSORT Requires AMS to build the Alternate Index Records within the users address space if possible EXTERNALSORT Indicates that two ESDS work Files are to be used by AMS for the sort WORKFILES Specifies The DD names to be used instead of the default Names CREATION OF PATH EXAMPLE BLDINDEX INDATASET(USER1.KSDS.CLUSTER)OUTDATASET(USER1.KSDS.AIX)

Once you have defined any alternate indexes, You must define a separate path for each one, using the IDCAMS DEFINE PATH command. This path name is the dataset name that you use in the jcl when processing an alternate index. It is a separate catalog entry and forms a logical connection(path) through the alternate index to the base cluster A path is a catalog record. It is normally used to relate the alternate index and the base cluster IDCAMS DEFINE PATH is used to create a path record in the catalog.

SYNTAX: DEFINE PATH(NAME(PATH NAME) PATHENTRY(AIX NAME) -

iFrames Technologies

57

Mainframe /* Step 3: SPECIFYING THE ALTERNATE INDEX PATH Example: DEFINE PATH (NAME(XIND.NLT.VSAM.DEPT.PATH) PATHENTRY (XIND.NLT.VSAM.DEPT.AIX) UPDATE) - Path is a VSAM object though it doesnt contain any records - Same command for KSDS & ESDS //BLDINDX //SYSPRINT //DD1 //DD2 //IDCVT1 //IDCVT2 //SYSIN EXEC PGM=IDCAMS DD SYSOUT = * DD DSN=XIND.NLT.VSAM,DISP=OLD DD DSN=XIND.NLT.VSAM.DEPT.AIX,DISP=OLD DD DSN=XIND.NLT.WRKFILE1, DISP=OLD DD DSN=XIND.NLT.WRKFILE2, DISP=OLD DD * INFILE (DD1) OUTFILE (DD2) ALTERNATE INDEX FOR ESDS Same syntax & parameters as KSDS Not supported in Batch COBOL (OS/VS & VSII) Used under CICS environment Step 2: BUILDING THE INDEX UPDATE / NOUPDATE)

VSAM

NAME specifies the name of the PATH. PATHENTRY associates the AIX with the path name. UPDATE / NOUPDATE specifies whether all of the upgrade set should be maintained by VSAM when accessing through this path EXAMPLE: DEFINE PATH ( NAME(USER1.KSDS.PATH) PATHENTRY(USER1.KSDS.AIX)UPDATE )

BLDINDEX Command actually builds the index and populates it with records

BLDINDEX

INTERNALSORT

- Path is used to link JCL DSN to VSAM AIX (specifies that the given AIX is to be used). NAME Syntax: NAME (pathname). Pathname becomes the DSN in the run JCL

iFrames Technologies

58

Mainframe RESTRICTIONS FOR ALTERNATE INDEX No Alternate Index For RRDS and LDS. Base Cluster Must Not Be Empty For Buildindex. Length Of The Alternate Index Not Exceed 255 Maximum Number Of Alternate Key Pointers Is 32k. Records Larger Than 32760 Not Supported By Repro/Export. PATHENTRY Syntax: PATHENTRY (entry name/password).

VSAM

Entry name: name assigned to alternate index cluster. Required for an alternate index

For A Base Cluster With Alternate Index(Es) And Path(S),Delete Cluster Deletes Not Only The Base Cluster But Also The Associated Alternate Index

Maximum Alternate Indexes Can Be 253 For A Single Dataset(ESDS&KSDS)

REVIEW QUESTIONS: 1. An alternate index can be defined for which cluster type(s)? a.) KSDS AND RRDS b) c) d) 2. KSDS AND ESDS KSDS only KSDS,ESDS AND RRDS.

The size of an alternate index is about the same of its base cluster. a) true b)false

iFrames Technologies

59

Mainframe 5 4.

VSAM

3. If an application program accesses a base cluster in alternate key sequence, then DD statements are needed for which data set(s)? a) Base cluster b) alternate index c) path d) (a) and(b) e) (a) and c An alternate index itself is which cluster type? a) LDS b) RRDS c) ESDS d) KSDS e) NONE OF THE ABOVE. An alternate index is a spanned record dataset. a) true b)false 6) A path is required so that an application program base cluster keys and retrieve alternate records. a) true b) false 7) Is it slower if you access a record through ALTERNATIVE INDEX as compared to Primary INDEX? 8) 9) 10) 11) What could be the maximum number of the AIXs per base cluster? Can AIX be defined over an ESDS, which does not have any Key? What is an Alternate Index? What are the steps used to create an Alternate Index?

12) What are the restrictions to be considered while creating an Alternate Index?

iFrames Technologies

60

Vous aimerez peut-être aussi