Bulletin Board

What’s new at MAINFRAMES 360
(Updates June '10)...
- I am writing articles on CICS. The effort would be to make the material of certain standard, practical and easy to comprehend.
- JCL needs fresh look, and more weightage needs to assigned to conventions and practises adopted in Production Environments at most sites
- A note of appreciation : Thanks to all our followers, for making Mainframes360 a success!

Mainframes360 Search

Loading

Quick Links

Jump to :  

Monday, July 27, 2009

VSAM Tutorial – How to create a ESDS and RRDS Cluster


Q. How do you create an ESDS Object using JCL/Batch JOB?
An ESDS Cluster is a VSAM Dataset, which is similar to a sequential file. An ESDS Dataset has no Index Structure. Now, you might wonder, how to access the records of an ESDS Cluster. Well, to access a record in an ESDS Cluster, you need to know the exact address/physical location, where record lies on the Disk Volume. It’s like saying, if you had a 1000 page book, and you wanted to access the line having keyword laugh, you must know beforehand on which page no(address) laugh is.

Thus, Records in ESDS Cluster are accessed by their Physical Address. This address is called Relative Byte Address(RBA). ESDS works just like a stack/pile of books. If you add records, they always get added to the top of the pile/stack, i.e. the records get appended. Since the pile is too heavy, it is not possible to insert records in between.

Here, I’ve shown how to create an empty ESDS Cluster using IDCAMS, DEFINE CLUSTER Control statement.

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
//MYJOB004 JOB A123,QUASAR,NOTIFY=&SYSUID                              
//STEP01 EXEC PGM=IDCAMS                                               
//SYSPRINT DD DSN=CAA0176.DEMO.JOBLOG,DISP=(OLD,KEEP,KEEP)             
//SYSIN  DD   *                                                        
  DEFINE CLUSTER(                                                      -
                 NAME(CAA0176.DEMO.ESDS)                               -
                 TRACKS(1 1)                                           -
                 RECORDSIZE(80 80)                                     -
                 NONINDEXED                                            -
                 )                                                     -
  DATA(                                                                -
                 NAME(CAA0176.DEMO.ESDS.DATA)                          -
       )                                                               
/*                                                                     
//                                                                     


In the above example, I’ve created a new ESDS Cluster with the name CAA0176.DEMO.ESDS. This ESDS Cluster will be allocated space(extents) in terms of 1 Primary Track and 1 Secondary Track. All records in this ESDS Cluster will be of length 80 bytes. Moreover, since an ESDS Cluster does not have any key, we don’t write KEYS keyword. Also, ESDS Cluster is specified using the option NONINDEXED.

Since, it has on DATA Component, only the DATA Sub-parameter has been coded. The ESDS Data component will have the name – CAA0176.DEMO.ESDS.DATA.
Q. How do you create an RRDS Object using a Batch JOB/JCL?
In a Relative Record Dataset, you must recall that each record is identified by a Relative Record Number(RRN), which is nothing but the sequence number relative to the first record.

Note : As opposed to KSDS, ESDS and RRDS support only fixed length records.

In RRDS, space is divided into fixed length slots. A slot can be either completely vacant(does not contain a record) or completely full(contains a record). Thus, you can add new records to empty slots, and delete existing records from slots which are filled.

Let’s see a simple JCL to create an RRDS Cluster :

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
//MYJOB004 JOB A123,QUASAR,NOTIFY=&SYSUID                              
//STEP01 EXEC PGM=IDCAMS                                               
//SYSPRINT DD DSN=CAA0176.DEMO.JOBLOG,DISP=(OLD,KEEP,KEEP)             
//SYSIN  DD   *                                                        
  DEFINE CLUSTER(                                                      -
                 NAME(CAA0176.DEMO.RRDS)                               -
                 TRACKS(1 1)                                           -
                 RECORDSIZE(80 80)                                     -
                 NUMBERED                                              -
                 REUSE                                                 -
                 )                                                     -
  DATA(                                                                -
                 NAME(CAA0176.DEMO.RRDS.DATA)                          -
       )                                                               
/*                                                                     
//                                                                     


RRDS is created on the same lines, like how we created an ESDS. The only difference being that since RRDS records are accessed by RRN(Sequence Number), we must code NUMBERED inside the DEFINE CLUSTER AMS Command.

0 comments:

Post a Comment

Related Posts with Thumbnails

Quick Links

Jump to :  

Note :

© Copyright – Quasar Chunawalla, 2010.
Note : The copyrights of all the material, text and pictures posted in this website belong to the author. Any instance of lifting the material from this website, shall be considered as an act of plagiarism. For any clarifications, please mail at quasar.chunawalla@gmail.com
 
back to top