300+ TOP VSAM Interview Questions – Answers

  1. 1. What Is Vsam?

    VSAM stands for Virtual Storage Access Method. It’s a Data Management method used to organize, store, catalog, retrieve and delete the datasets in mainframe system (VSAM and Non-VSAM). This access method makes it easier for an application to execute an I/O operation (moving data between an I/O device and memory). In fact VSAM is the first access method designed for Virtual Storage Environment.

    VSAM supports fixed as well as variable length records. These records are placed in blocks of Control Intervals and these control intervals are further placed as Control Area (CA consists of multiple CIs).

  2. 2. What Are The Advantages Of Vsam?

    • Accessing the data is faster and easier.
    •  VSAM supports more dataset types.
    • Supports variety of I/O Techniques.
    • Improves Efficiency.
    • Records can be accessed sequentially or randomly.

  3. IBM – VSAM Interview Questions

  4. 3. What Are The Disadvantages Of Vsam?

    • VSAM Datasets require more storage space compared to other type of datasets due to Control information(CI) present in them.
    • VSAM can’t be stored in TAPE Volume i.e., VSAM Stored only in DASD.
    • VSAM is not a database like DB2, IMS DB & IDMS.
  5. 4. What Is Purpose Of Vsam?

    VSAM acts as an interface between Application program & Operating System.


  6. File Maker Tutorial

  7. 5. What Is The Maximum Record Length For The Vsam Dataset?

    Max size of a record in VSAM is cylinder = 2880 bytes approx.


  8. JCL Interview Questions

  9. 6. What Is File Status In Vsam?

    The File STATUS clause of the FILE-CONTROL paragraph allows for each file to be associated with afile status key (i.e., the 2-character data item specified in the FILE STATUS clause). If the FILE STATUS clause is specified for a given file, a value indicating the status of each I/O operation against that file is placed in the accociated file status key. This value is stored in the file statuskey as soon as the I/O operation is completed (and before execution of any EXCEPTION/ERROR declarative or INVALIDKEY/AT END phrase associated with the I/O request).
    Note:
    This element may behave differently when the CMPR2 compiler option is used. The file statuskey is divided into two status keys: the first character is known as file status key1; the second character is file status key 2.

  10. 7. What Is The Length Of A Rdf?

    3 Bytes


  11. IBM DB2 Tutorial
    File Maker Interview Questions

  12. 8. What Is The Length Of A Cidf?

    4 Bytes

  13. 9. What Is The Maximum Size Of A Ci (control Interval)?

    32 KBytes (32 * 1024* 8)


  14. IBM DB2 Interview Questions

  15. 10. What Are The Different Types Of Vsam Files Available?

    ESDS: Entry Sequence Data Set
    KSDS: Key Sequence Data Set
    RRDS: Relative Data Set


  16. COBOL Tutorial

  17. 11. What Is Idcams ?

    IDCAMS is the Access Method Services program. You run the IDCAMS program and supply AMS commands thru SYSIN. (examples of AMS commands are DELETE, DEFINE, REPRO etc..).


  18. COBOL Interview Questions

  19. 12. Can Ams Commands Be Run From The Tso Prompt ?

    Yes


  20. IBM – VSAM Interview Questions

  21. 13. Under Idcams , Multiple Functions Can Be Executed, Each Of Which Returns A Cond Code. What Will Be The Condition Code Returned To The Operating System ?

    The maximum condition code generated is returned as the condition code of the IDCAMS step.


  22. IBM-JCL Tutorial

  23. 14. What Is Control Interval, Control Area ?

    Control Interval is analogous to a physical block for QSAM files. It is the unit of i/o. Must be between 512 bytes to 32 k. Usually either 2K or 4K. A larger control interval increases performance for sequential processing while the reverse is true for random access. Under CICS when a record is locked, the entire CI gets locked. Control area is a group of control intervals. CA is used during allocation. CA size is calculated based on the allocation type (cyl, tracks or records) and can be max of 1 cylinder.

  24. 15. What Is Freespace ?

    Coded in the DEFINE as FREESPACE(ci ca) where ci is the percentage of each control interval to be left free for insertions, ca is the percentage of control intervals in each control area to be left empty.


  25. IBM-JCL Interview Questions

  26. 16. How Do You Decide On Optimum Values For Ci, Freespace Etc..?

    CI size should be based on record length, type of processing. Usually CI is 4K. If record length is larger(>1K), chose 6K or 8K. FREESPACE should be large if more number of insertions are envisaged. Usual values are (20,20) when heavy updates are expected. CI size can be calculated.


  27. DB2 Using SQL Tutorial

  28. 17. Would You Specify Freespace For An Esds?

    No. Because you cannot insert records in an ESDS, also when you rewrite a record, it must be of the same length. Thus putting any value for freespace does not make any sense.


  29. DB2 Using SQL Interview Questions

  30. 18. What Is Shareopts ?

    SHAREOPTS is a parameter in the DEFINE and specifies how an object can be shared among users. It is coded as SHAREOPTS(a b), where a is the cross region share option ie; how two or more jobs on a single system can share the file, while b is the cross systemshare option ie how two or more jobs on different MVSes can share the file. Usual value is (2 3).


  31. JCL Interview Questions

  32. 19. What Is The Meaning Of Each Of The Values In Shareopts(2 3)?

    Value of 2 for cross region means that the file can be processed simultaneously by multiple users provided only one of them is an updater. Value of 3 for cross system means that any number of jobs can process the file for input or output (VSAM does nothing to ensure integrity).


  33. IBM Mainframe Tutorial

  34. 20. How Do You Define A Ksds ?

    DEFINE CLUSTER(cluster name) with the INDEXED parameter. Also specify the ds name for the DATA component & the ds INDEX component. Other important parms are RECORDSIZE, KEYS, SHAREOPTIONS.


  35. IBM-JCL&VSAM Interview Questions

  36. 21. What Happens When You Open An Empty Vsam File In A Cobol Program For Input?

    A VSAM file that has never contained a record is treated as unavailable. Attempting to open for input will fail. An empty file can be opened for output only. When you open for output, COBOL will write a dummy record to the file & then delete it out.

  37. 22. How Do You Initialize A Vsam File Before Any Operation? A Vsam With Alternate Index?

    Can write a dummy program that just opens the file for output & then closes it.


  38. IMS/DB Tutorial

  39. 23. What Does A File Status Of 02 On A Vsam Indicate?

    Duplicate alternate key . Happens on both input and output operation.


  40. IBM Mainframe Interview Questions

  41. 24. What Is The Difference Between Sequential Files And Esds Files?

    Sequential(QSAM) files can be created on tape while ESDS files cannot. Also, you can have ALTINDEX for an ESDS while no such facility exists for QSAM files.


  42. File Maker Interview Questions

  43. 25. How Do You Load A Vsam Data Set With Records ?

    Using the REPRO command.

  44. 26. How Do You Define A Gdg ?

    Use the DEFINE GENERATIONDATAGROUP command. In the same IDCAMS step, another dataset must be defined whose DCB parameters are used when new generations of the GDG are created. This dataset is known as the model dataset. The ds name of this model dataset must be the same as that of the GDG, so use a disp of keep rather than catlg and also specify space=(trk,0).


  45. COBOL, CICS, JCL, VSAM, DB2 Interview Questions

  46. 27. Do All Versions Of The Gdg Have To Be Of The Same Record Length ?

    No, the DCB of the model dataset can be overridden when you allocate new versions.


  47. IBM DB2 Interview Questions

  48. 28. How Are Different Versions Of Gdg Named ?

    base-file-name.GnnnnnV00 where nnnn= generation number (upto 255). nnnn will be 0000 for the 1st generation.

  49. 29. Suppose 3 Generations Of A Gdg Exist. How Would You Reference The 1 St Generation In The Jcl?

    Use GDG name(-2).


  50. Cisco Interview Questions

  51. 30. Suppose A Generation Of Gdg Gets Created In A Particular Step Of A Proc. How Would You Refer The Current Generation In A Subsequent Step? What Would Be The Disposition Of This Generation Now?

    Relative generation numbers are updated only at the end of the job, not at the end of a step. To allocate a new generation, we would be using (+1) with a DISP of (NEW,CATLG,DELETE). To refer to this in a subsequent step in the same job, we would again use (+1) but with a DISP of SHR or OLD.

  52. 31. What More Info You Should Give In The Dd Statement While Defining The Next Generation Of A Gdg?

    Give (+1) as the generation number, give (new,catlg) for disp, give space parameter, can give the dcb parameter if you want to override the dcb of the model dataset.

  53. 32. Assuming That The Define Jcl Is Not Available, How Do You Get Info About A Vsam File’s Organisation ?

    Use the LISTCAT command.


  54. IMS/DB Interview Questions

  55. 33. During Processing Of A Vsam File, Some System Error Occurs And It Is Subsequently Unusable .what Do You Do ?

    Run VERIFY.


  56. COBOL Interview Questions

  57. 34. If Fspc(100 100) Is Specified Does It Mean That Both The Control Interval And Control Area Will Be Left Empty Because 100 % Of Both Ci And Ca Are Specified To Be Empty?

    No, they would not be left empty. one record will be written in each CI and 1 CI will be written for each CA.

  58. 35. What Is A Base Cluste?

    The Index and data components of a KSDS.

  59. 36. What Is The Rrn For The First Record In Rrds?

    1


  60. IBM-JCL Interview Questions

  61. 37. How Many Times Secondary Space Allocated?

    122 TIMES

  62. 38. What Is The Device Independent Method To Indicate Where A Record Is Stored?

    By USING RBA (Relative Byte Address).

  63. 39. What Is The Biggest Disadvantage Of Using A Vsam Dataset?

    FREE SPACE ( FPSC )

  64. 40. How Many Buffers Are Allotted To Vsam Ksds And Esds?

    2 data buffers by default for ESDS. For KSDS it allots 2 data buffers and 1 index buffers. each buffer is about 4K.


  65. DB2 Using SQL Interview Questions

  66. 41. What Is An Alternate Index And Path?

    An alternate index is an another way of accessing key sequenced data record stored in a base cluster and path is the linkage which connect alternate index to its base cluster.

  67. 42. Is A Delete Operation Possible In An Esds? B, Is Rewrite Operation Possible In Esds?

    No delete operation is not possible in VSAM ESDS.B. yes rewrite operation is possible in an ESDS.


  68. IBM-JCL&VSAM Interview Questions

  69. 43. What Is The Difference Between Lds And Esds?

    There two datasets are VSAM datasets. ESDS maintains control information. But LDS does not maintains the control information.

  70. 44. How To Delete A Member Using Jcl?

    Using IDCAMS a member can be deleted. DELETE XXX.YYY (member)

  71. 45. What Is Idcams? And What Is The Purpose Of It?

    IDCAMS is an access method services utility used for creating, deleting, altering VSAM files and copying sequential file to a VSAM file, etc.

  72. 46. What Are The Optional Parameters To The Input Dataset While Loading The Empty Cluster With The Data Records?

    1) FROMADDRESS(address)
    2) TOADDRESS(address) where ‘address’ specifies the RBA value of the key of the input record.
    3) FROMNUMBER (rrn)
    4)TONUMBER (rrn) where ‘rrn’ specifies the relative record number of the RRDS record
    5) FROMKEY (key)
    6) TOKEY (key) where ‘key’ specifies the key of the input record
    7) SKIP (number)
    8) COUNT (number) where ‘number’ specifies the number of records to skip or copy Ex: REPRO INFILE(DD1) OUTFILE(DD2) SKIP(9000) COUNT(700)-Skips the first 9000 records and begin copying at 9001 and copies 700 records from DD1 to DD2.

  73. 47. What Does The Keyranges Parameter In Define Cluster Commends Do?

    It divides a large dataset into several volumes according to the Key ranges specified. e.g. KEYRANGES ((0000001 2999999) (3000000 5999999)). if the activity on the key ranges are evenly distributed, concurrent access is possible, which is a performance inprovement.

  74. 48. Describe Shareoptions Parameter (shr) In Define Cluster Command?

    It define the cross-region and cross-system sharing capabilities of the dataset. Syntax is SHR (Crvalue, CSvalue) value 1 means multiple read OR single write (read integrity ) 2 means multiple read AND single write ( Write integrity ) 3 means Multiple read AND multiple write 4 is same as 3, which refreshes the buffer with every random access defualt is SHR(1 3).

  75. 49. What Is Recovery And Speed Parameters In Define Cluster Command?

    RECOVERY (default ) and SPEED are mutually exclusive. Recovery performats the control areas during the initial dataset load, if the job fails, you can restatt but you must have a recovery routine already written to restart the job. SPEED does not preformat the CAs. It is recommended that you specify SPEED to speed up your initial data load.

  76. 50. Is It Slower If You Access A Record Through Alt Index As Compared To Primary Index?

    Yes. Why? Because the alternate key would first locate the primary key, which in turn locates the actual record. Needs twice the number of I/Os.

  77. 51. How Many Alternate Indexes You Can Have On A Dataset?

    255 – but you must be a nut to have so many ALT Indexes on a dataset !

  78. 52. On Which Dataset You Can Have Alt Index?

    only on KSDS and ESDS – not RROS

  79. 53. What Is The Meaning Of Vsam Return-code 28?

    Out of space condition is raised.

  80. 54. How Do You Fix The Problem Associated With Vsam Out Of Space Condition?

    Define new VSAM dataset allocated with more space.
    Use IDCAMS to REPRO the old VSAM file to new VSAM dataset.
    Use IDCAMS to ALTER / rename the old VSAM dataset or se IDCAMS to DELETE the old VSAM datset.
    Use IDCAMS to ALTER / rename the new VSAM dataset to the name of the original VSAM dataset.

  81. 55. During Processing Of A Vsam File, Some System Error Occurs And It Is Subsequently Unusable What Do You Do?

    Run VERIFY.

  82. 56. How Are Different Versions Of Gdg Named?

    base-file-name. GnnnnnnV00 where nnnn=generation number (upto 255). nnnn will be 0000 for the 1st generation.

  83. 57. How Do You Define A Gdg?

    Use the DEFINE GENERATIONDATAGROUP command. In the same IDCAMS step, another dataset must be defined whose DCB parameters are used when new generations of the GDG are created. This dataset is known as the model dataset. The DS name of this model dataset must be the same as that of the GDG, so use a disp of keep rather than catlg and also specify space = (trk,0).

  84. 58. How Do You Calculate Record Size Of An Alternate Cluster? Give Your Values For Both Unique And Nonunique?

    UniqueCase: 5 + (alt-key-length + primary – key )
    Non unique Case: 5 + (alt-key-length + n * primary – key ) where n = number of duplicate records for the alternate key.

  85. 59. How Do You Load A Vsam Data Set With Records?

    Using the REPRO command.

  86. 60. Do All Versions Of The Gdg Have To Be Of The Same Record Length?

    No, the DCB of the model dataset can be overridden when you allocate new versions.

  87. 61. Suppose 3 Generations Of A Gdg Exist. How Would You Reference The 1st Generation In The Jcl?

    Use GDG name(-2).

  88. 62. Assuming That The Define Jcl Is Not Available, How Do You Get Info About A Vsam Files Organisation?

    Use the LISTCAT command.

  89. 63. Using Alternate Indexes In Cics Program?

    FCT entires must be created for both base cluster and the path. To read using the alternate index, use the DD name of the path in CICS file control commands.

  90. 64. Using Alternate Indexes In Batch Program?

    In the JCL, you must have DD statements for the cluster and for the path9s). In the COBOL program, SELECT … ASSIGN TO ddname for base cluster RECORD KEY IS… ALTERNATE RECORD KEY IS.

  91. 65. What Is A Lds (linear Data Set) And What Is It Used For?

    LDS is a VSAM dataset in name only. It has unstructured 4k (4096 bytes ) fixed size CT’s which do not contain control fields and therefore from VSAM’s standpoint they do not contain any logical records. There is no free space, and no access from Cobol. Can be accessed by DB2 and IMS fast path datasets. LDS is essentially a table of data maintained on disk. The ‘table entries’ must be created via a user program and can only be logically accessed via a user program. When passed, the entire LDS must be mapped into storage, and then data is accessed via base and displacement type processing.

  92. 66. What Is The Meaning Of The Define Model Parameter?

    It specifies whether Daniela Pestova or Yamila – oops! Wrong models! The MODEL parameter allows you to model your cluster by modeling it after an existing cluster.

  93. 67. What Are The Three Levels Of Definition For The Vsam Define?

    They are DEFINE CLUSTER, DATA and INDEX.

  94. 68. What Is The Utility Program Closely Associated With Vsam?

    IDCAMS, the access mehtod services utility.

  95. 69. What Is The Vsam-code Field?

    It is a COBOL II enhancement to VSAM batch processing expanding the FILE STATUS field. It is defined in WORKING-STORAGE as a six byte group item with three two byte elements, the normal return code, the function code and the feedback code.

  96. 70. What Is The Meaning Of Dynamic Processing?

    It’s rarely used. It means one program uses both sequential and random processing for a VSAM KSDS file.

  97. 71. Under Idcams, Multiple Functions Can Be Executed, Each Of Which Returns A Condition Code. What Will Be The Condition Code Returned To The Operating System?

    The maximum condition code generated is returned as the condition code of the IDCAMS step.

  98. 72. Would You Specify Freespace Ce For An Esds?

    No. Because you cannot insert records in an ESDS, also when you rewrite a record, it must be of the same length. Thus putting any value for FREESPACE does not make any sense.

  99. 73. What Is The Meaning Of Each Of The Values In Shareopts (2 3)?

    Value of 2 for cross region means that the file can be processed simultaneously by multiple users provided only one of them is an updater. Value of 3 for cross system means that any number of jobs can process the file for input or output (VSAM does nothing to ensure integrity).

  100. 74. How Do You Define An Altindx? How Do You Use Altindxs In Batch, Cics Programs?

    DEFINE ALTERNATEINDEX. Important parameters are RELATE where you specify the base cluster name, KEYS, RECORDSIZE, SHAREOPTION, UNIQUEKEY (or NONUNIQUEKEY), DATA (DS NAME for the data component), INDEX(DS name for the index component). Then DEFINE PATH. Important paramters are NAME (DS name for the path). PATHENTRY (DS name of the alternate index name). UPDATE (or NOUPDATE) which specifies whether an ALT index is updated when a update to the vase cluster takes place. Then BLDINDEX. Paramters are INDATASET (DS name of base cluster), OUTDATASET (DS name of AIX).

  101. 75. Name Some Common Vsam Error Conditions And Codes?

    They are end of file (10), duplicate key (22), record not found (23), VSAM logic error (90), open problem (92) and space problem (93).

  102. 76. What Is A Vsam Slot?

    A relative record dataset (RRDS) consists of a specified number of areas called slots. Each slot is identified by a relative record number (RRN) which indicates its relative position in the file.

  103. 77. There Are At Least Seven Idcams Commands Name And Explain Each Of Them?

    ALTER modifies information for a catalog, alternate index, cluster or path. BLDINDEX builds the alternate index, of course. DEFINE is used for ALTERNATEINDEX, CLUSTER or PATH. DELETE removes the catalog entry for a catalog, cluster, alternate index or path. LISTCAT lists information about the dataset. PRINT prints the dataset contents. REPRO copies records from one file to another.

  104. 78. What Is The Significance Of The Shareoptions Parameter?

    It specifies how the file may be shared between jobs and between batch and CICS environments.

  105. 79. If You Wish To Use The Rewrite Command How Must The Vsam File Be Opened?

    It must be opened as I/O.

  106. 80. What Is The Cobol Record Key Clause?

    The RECOED KEY in the SELECT clause identifies the files primary key as it will be known to the program.

  107. 81. In The Cobol Select Statement What Is The Organization For A Ksds?

    The ORGANIZATION is INDEXED.

  108. 82. What Is The Base Cluster?

    The base cluster consists of the data component and the index component for the primary index of a KSDS.

  109. 83. What Is Free Space?

    Free space is reserved within the data component of a KSDS to accommodate inserting new records.

  110. 84. What Is A Path?

    A path is a file that allows you to access a file by alternate index – the path provides an association between the AIX and the base cluster.

  111. 85. What Is A Ci, Control Interval?

    A control interval is the unit of information that VSAM transfers between virtual and auxilliary storage.

  112. 86. What Is A Ca, Control Area?

    A group of control intervals makes up a control area.

  113. 87. What Is The Index Set?

    This is the other part of the index. It has multiple levels with pointers that ultimately reach to the sequence set.

  114. 88. What Is The Catalog?

    The catalog contains the name of all datasets. VSAM and non-VSAM. It is used to access these datasets.

  115. 89. What Is The Purpose Of The File Status Clause In The Select Statement?

    The FILE STATUS field identifies the field that VSAM uses to provide information about each I/O operation for the file.

  116. 90. In The Cobol Select Statement For A Ksds What Are The Three Possibilities For Access?

    ACCESS can be SEQUENTIAL, RANDOM or DYNAMIC.

  117. 91. Do Primary Key Values Have To Be Unique? Do Alternate Key Values Have To Be Unique?

    Primary key values must be unique; alternate key values need not be.

  118. 92. What Is A Vsam Split?

    If there isn’t enough space in the control interval VSAM performs a control interval split by moving some records to the free control intervals. If there isn’t a free control interval VSAM performs a control area split by allocating a new control area and moving half of the control intervals to it.

  119. 93. What Is The Upgrade Set?

    The upgrade set is the list of all AIXes that VSAM must maintain for a specific base cluster, so that when data in the base cluster is updated, the AIX files are also updated.

  120. 94. What Is An Alternate Index?

    An AIX is a file that allows access to a VSAM dataset by a key other than the primary one.

  121. 95. What Is A Cluster?

    A cluster is the combination of the index, sequence set and data portions of the dataset. The operating system gives program access to the cluster, ie; to all parts of the dataset simultaneously.

  122. 96. What Is A Sequence Set?

    This is the part of the index that points to the CA and CI of the record being accessed.

  123. 97. What Are The Distinctive Features Of A Ksda, Key Sequenced Dataset?

    The index and the distributed free space.

  124. 98. How Are Records Stored In An Esds, Entry Sequenced Dataset?

    They are stored without respect to the contents of the records and in the order in which they are included in the file.

  125. 99. What Are The Types Of Vsam Datasets?

    Entry sequenced dataset (ESDS), key sequenced datasets (KSDS) and relative record dataset (RRDS).

  126. 100. Syntax Of Ams Modal Commands?

    Note:
    these can be used only under IDCAMS and not from the TSO prompt.

    IF LASTCC(or MAXCC) >(or <,= etc..) value -
    THEN –
    DO –
    command set (such as DELETE, DEFINE etc..)
    ELSE –
    DO –
    command set.

    LASTCC – Condition code from the last function(such as delete) executed.
    MAXCC – Max condition code that was returned by any of the prev functions.
    SET is also a valid AMS command. SET LASTCC (or MAXCC) = value.
    The maximum condition code is 16. A cond code of 4 indicates a warning. A cond code of 8 is usually encountered on a DELETE of a dataset that is not present.