Example: bachelor of science

Chapter 28: Virtual Storage Access Method (VSAM)

Page496 Chapter 28 Revised January 19, 2010 Copyright 2009 byEdward L. Bosworth, 28: Virtual StorageAccess Method ( vsam )Author s Note:This Chapter is copied almost verbatim from the material inChapter19of the textbook by Peter is used by ( vsam ) is a relatively recent file organization methodfor users of IBMOS/VS and facilitates both sequential andrandomprocessing and supplies a number of useful utility termfileis somewhat ambiguous since it may reference an I/O device orthe recordsthat the device processes. To distinguish a collection of records,IBMOS literature usesthe termdata provides three types of data sets:1. Key-sequenced Data Set (KSDS).KSDS maintains records in sequence ofkey, such asemployee or part number, and is equivalent to indexed sequentialaccess Method (ISAM).2. Entry-sequenced Data Set (ESDS).ESDS maintains records in the sequencein whichthey were initially entered and is equivalent to sequential Relative-Record Data Set (RRDS).

Page 496 Chapter 28 Revised January 19, 2010 Copyright © 2009 by Edward L. Bosworth, Ph.D. Chapter 28: Virtual Storage Access Method (VSAM) Author’s Note: This chapter is copied almost verbatim from the material in

Tags:

  Virtual, Methods, Chapter, Access, Storage, Chapter 28, Virtual storage access method, Vsam

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of Chapter 28: Virtual Storage Access Method (VSAM)

1 Page496 Chapter 28 Revised January 19, 2010 Copyright 2009 byEdward L. Bosworth, 28: Virtual StorageAccess Method ( vsam )Author s Note:This Chapter is copied almost verbatim from the material inChapter19of the textbook by Peter is used by ( vsam ) is a relatively recent file organization methodfor users of IBMOS/VS and facilitates both sequential andrandomprocessing and supplies a number of useful utility termfileis somewhat ambiguous since it may reference an I/O device orthe recordsthat the device processes. To distinguish a collection of records,IBMOS literature usesthe termdata provides three types of data sets:1. Key-sequenced Data Set (KSDS).KSDS maintains records in sequence ofkey, such asemployee or part number, and is equivalent to indexed sequentialaccess Method (ISAM).2. Entry-sequenced Data Set (ESDS).ESDS maintains records in the sequencein whichthey were initially entered and is equivalent to sequential Relative-Record Data Set (RRDS).

2 RRDS maintains records in order ofrelative recordnumber and is equivalent to direct file sameway and use similar supportprogramsand macros, although OS has a number of extended coverage of assembler vsam would require an entire , thischapter supplies enough information to enable you to code programsthat create, retrieve,and update a vsam data set. For complete details, see theIBM Access methods Servicesmanual and theIBM DOS/VSE MacrosorOS/VSSupervisor Services the table below,RBAstands for Relative Byte Address , the byte s displacementfrom the start of the data SequencedEntry SequencedRelative RecordKSDSESDSRRDSR ecord sequenceBy keyIn sequence inwhich enteredIn sequence ofrelative recordnumberRecord lengthFixed or variableFixed or variableFixed onlyAccess of recordsBy key viaindex or RBABy RBABy relativerecord numberChange of addressCan change recordRBAC annot changerecord RBAC annot changerelative recordnumberNew recordsDistributed freespace for recordsSpace at end ofdata slot indata of spaceReclaim space ifrecord is delete, butcanoverwrite old reusedeleted 28 1 Features of vsam organization methodsS/370 AssemblerVSAMPage496 Chapter 28 Revised January 19.

3 2010 Copyright 2009 byEdward L. Bosworth, INTERVALSFor all three types of data sets, vsam stores records in groups (one or more) ofcontrolintervals. You may selectthe control interval size, but if you allow VSAMto do so, itoptimizes the size based onthe record lengthand the type, of diskdevice being used. Themaximum size of a control interval is 32,768 end of each control interval iscontrol informationthatdescribesthedata records:Rec 1 Rec 2 Rec InformationA control interval contains one or more data records, and a specified numberof controlintervals comprise a control area. vsam addresses a data record byrelative byte address(RBA)-itsdisplacement fromthe start ofthe data ,the first record of adata set is at RBA 0, and if records are 500bytes long,the second record is at RBA list in 1 comparesthethree types of vsam METHODSERVICES(AMS)Before physically writing (or "loading") records in a vsam data set, you firstcatalog itsstructure.

4 The IBM utility package,AccessMethodServices (AMS),enables you tofurnish vsam with such details aboutthe data set as its name,organization type, recordlength, key location, and password (if any). Since vsam subsequently knowsthephysical characteristics ofthe data set, your program neednot supply as much detailedinformation as would a program accessing an following describes the more important features of AMS. Full detailsare in the IBMOS/VSandDOS/VSAccess methods Services manual. You cataloga vsam structureusing an AMS program named IDCAMS, as follows:OS://STEP EXEC PGM=IDCAMSDOS://EXEC IDCAMS,SIZE=AUTOI mmediately following the command are various entries that DEFINE thedata set. Thefirst group under CLUSTER provides required and optional entriesthat describe all theinformation that vsam must maintain for the data set. Thesecond group, DATA, createsan entry in the catalog for a data component, thatis, the set of all control area andintervals for the Storage of records.

5 The thirdgroup, INDEX, creates an entry in thecatalog for a KSDS index component forthe handling of the KSDS 2 provides the most common DEFINE CLUSTER entries. Notethat toindicate continuation, a hyphen ( ) follows every entry except the followingnotes apply to the :SYMBOLMEANING[ ]Optional entry, may be omitted{ }Select one of the following options( )You must code these parentheses|"or", indicates one of the choiceslisted in the brackets{A | B} means to select either A or BS/370 AssemblerVSAMPage497 Chapter 28 Revised January 19, 2010 Copyright 2009 byEdward L. Bosworth, LevelFigure 28 2 Entries for defining a vsam data set DEFINE CLUSTER (abbreviated DEF CL) provides various parameters allcontainedwithin parentheses. NAME is a required parameter that supplies the name of the data set. Youcan codethe name up to 44 characters with a period after each 8 or fewer characters, The name corresponds tojob control, as follows:OS://FILEVS DD DSNAME= ://DLBL FILEVS,' ',0,VSAMThe name FILEVS in this example is whatever name you assignto the filedefinition(ACB) in your program, such asfilename ACB DDNAME=FILEVS BLOCKS.

6 You may want to load the data set on an FBA device (such as3310 or3370) or on a CKD device (such as 3350 or 3380). For FBA devices,allocate thenumber of512 byteBLOCKS for the devices,the entryCYLINDERS (or CYL) or TRACKS allocates space. The entryRECORDS allocatesspace for either FBA or CKD. In all cases, indicatea primary allocation for agenerous expected amount of space and an optionalsecondary allocation forexpansion if AssemblerVSAMPage498 Chapter 28 Revised January 19, 2010 Copyright 2009 byEdward L. Bosworth, Choose one entry to designate the type of data set: INDEXED designateskey sequenced, NONINDEXED is entry sequenced, and NUMBERED isrelative record. KEYS for INDEXED only defines the length (from 1 to 255) and positionof the keyin each example, KEYS (6 0) indicates that the keyis 6 bytes longbeginning in position 0 (the first byte). RECORDSIZE (or RECSZ) provides the average and maximum lengths inbytes ofdata records.

7 Forfixed length records and for RRDS, the two entriesare example, code (120b120) for l20 byte records. VOLUMES (or VOL) identifies the volume serial number(s) of the DASD volume(s)where the data set is to reside. You may specify VOLUMES atany of the threelevels; for example, the DATA and INDEX componentsmay reside on CLUSTER supplies a number of additional specialized optionsdescribed in theIBMAMS AND PROCESSINGVSAM furnishes two types of accessing, keyed and addressed, and three types ofprocessing, sequential, direct, and skip sequential. The following chart shows thelegalaccessing and processing by type of organization:TypeKeyed AccessAddressed AccessKSDSS equentialDirectSkip sequentialSequentialDirectESDSS equentialDirectRRDSS equentialDirectSkip sequentialIn simple terms,keyed accessingis concerned with the key (for KSDS) andrelativerecord number (for RRDS).

8 For example, if you read a KSDS sequentially, vsam delivers the records in sequence by key (although they may be in adifferent sequencephysically).Addressed accessingis concerned with the RBA. For example, you can accessa record inan ESDS using the RBA by which it was stored. For either type ofaccessing Method , youcan process records sequentially or directly (and by skipsequential for keyed Access ).Thus you always use addressed accessing for ESDSand keyed accessing for RRDS andmay process either type sequentially or , by contrast, permits both keyedaccess (the normal) and addressed Access ,with both sequential and direct AssemblerVSAMPage499 Chapter 28 Revised January 19, 2010 Copyright 2009 byEdward L. Bosworth, SEQUENCED DATA SETSA key-sequenced data set (KSDS) is considerably more complex than either ESDSorRRDS but is more usefuland versatile. You always create ("load") a KSDSin ascendingsequence by key and may process a KSDS directly by key or KSDS stores and retrieves records according to key, each key in thedata set must be 28 3 Key sequenced organization'Figure28 3 provides a simplified view of a key-sequenced data set.

9 Thecontrolintervals that contain the data records are depicted vertically, and for thisexample threecontrol intervals comprise a control area. Asequence setcontainsan entry for eachcontrol interval in a control area. Entries within a sequence setconsist of the highest keyfor each control interval and the address of the controlinterval; the address acts as apointer to the beginning of the control interval. Thehighest keys for the first control areaare 22, 32, and 40, respectively. vsam stores each high key along with an addresspointer in the sequence set for the firstcontrol a higher level, anindex set(various levels depending on the sizeof thedata set)contains high keys and address pointers for the sequence sets. In 3, the highestkey for the first control area is 40. vsam stores this value inthe index set along withan address pointer for the first a programwants to Access a record in the data set directly, vsam locates therecord first by means of the index set and then the sequence set.

10 Forexample, a programrequests Access to a record with key 63. vsam first checksthe index set as follows:RECORD KEYINDEX SETACTION6340 Record key high, not in first control key low, in second control AssemblerVSAMPage500 Chapter 28 Revised January 19, 2010 Copyright 2009 byEdward L. Bosworth, has determined that key 63 is in the second control area. It next examinesthesequence set for the second control area to locate thecorrect control are the steps:RECORD KEYSEQUENCESETACTION6355 Record key high, not infirst control key low, in second control has now determined that key 63 is in the second control interval of thesecondcontrol area. The address pointer in the sequence set directs vsam tothe correct controlinterval. vsam then reads the keys of the data set and locateskey 63 as the first recordthat it delivers to the SpaceYou normally allow a certain amount of free space in a data set for vsam toinsert newrecords.


Related search queries