Interview Questions   Tutorials   Discussions   Programs   Discussion   

VSAM - How can you create a VSAM dataset? Can you write a JCL for it?




300
views
asked mar August 24, 2014 11:58 AM  

How can you create a VSAM dataset? Can you write a JCL for it?


           

1 Answers



 
answered By Mswami   0  
Defining VSAM files:

You can process VSAM entry-sequenced, key-sequenced, and relative-record data sets in Enterprise COBOL only after you define them through access method services (IDCAMS).

A VSAM cluster is a logical definition for a VSAM data set and has one or two components:

  •     The data component of a VSAM cluster contains the data records.
  •     The index component of a VSAM key-sequenced cluster consists of the index records.

Use the DEFINE CLUSTER access-method services command to define VSAM data sets (clusters). This process includes creating an entry in an integrated catalog without any data transfer. Define the following information about the cluster:

  •     Name of the entry
  •     Name of the catalog to contain this definition and its password (can use default name)
  •     Organization (sequential, indexed, or relative)
  •     Device and volumes that the data set will occupy
  •     Space required for the data set
  •     Record size and control interval sizes (CISIZE)
  •     Passwords (if any) required for future access

Depending on what kind of data set is in the cluster, also define the following information for each cluster:

  •     For VSAM indexed data sets (KSDS), specify length and position of the prime key in the records.
  •     For VSAM fixed-length relative-record data sets (RRDS), specify the record size as greater than or equal to the maximum size COBOL record:

   
DEFINE CLUSTER NUMBERED
 RECORDSIZE(n,n)

        When you define a data set in this way, all records are padded to the fixed slot size n. If you use the RECORD IS VARYING ON data-name form of the RECORD clause, a WRITE or REWRITE uses the length specified in DEPENDING ON data-name as the length of the record to be transferred by VSAM. This data is then padded to the fixed slot size. READ statements always return the fixed slot size in the DEPENDING ON data-name.
  •     For VSAM variable-length relative-record data sets (RRDS), specify the average size COBOL record expected and the maximum size COBOL record expected:
   
DEFINE CLUSTER NUMBERED
 RECORDSIZE(avg,m)

        The average size COBOL record expected must be less than the maximum size COBOL record expected.
  •     For COBOL simulated variable-length relative-record data sets, specify the average size of the COBOL records and a size that is greater than or equal to the maximum size COBOL record plus 4:

   
DEFINE CLUSTER INDEXED
 KEYS(4,0)
 RECORDSIZE(avg,m)

        The average size COBOL record expected must be less than the maximum size COBOL record expected.

Define VSAM ESDS Cluster:

//IND220ES JOB (123),'INDUS',MSGLEVEL=(1,1),REGION=6M,   
//CLASS=A,MSGCLASS=A,NOTIFY=& SYSUID    
//***************************************************   
//* SAMPLE JCL TO CREATE ENTRY SEQUENCED DATA SET(ESDS)  
//***************************************************   
//STEPOZA EXEC PGM=IDCAMS          
//SYSPRINT DD SYSOUT=*          
//SYSOUT DD SYSOUT=*          
//SYSIN DD *            
 DEFINE CLUSTER(NAME(IND220.INDUS.STUDENT.ESDS.CLUSTER)-  
 RECORDSIZE(44,44)-           
CYLINDERS(3,2)-          
CISZ(4096)-             
NONINDEXED) -            
DATA(NAME(IND220.INDUS.STUDENT.ESDS.DATA))     
/*             
//  


flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert