YouTube Icon

Interview Questions.

Top 100+ Vsam Interview Questions And Answers - Jun 02, 2020

fluid

Top 100+ Vsam Interview Questions And Answers

Question 1. What Is Vsam?

Answer :

VSAM stands for Virtual Storage Access Method. It's a Data Management method used to organize, shop, catalog, retrieve and delete the datasets in mainframe system (VSAM and Non-VSAM). This get entry to method makes it easier for an software to execute an I/O operation (transferring statistics among an I/O tool and reminiscence). In truth VSAM is the primary get entry to approach designed for Virtual Storage Environment.

VSAM helps constant in addition to variable duration records. These statistics are placed in blocks of Control Intervals and those control intervals are in addition positioned as Control Area (CA consists of multiple CIs).

Question 2. What Are The Advantages Of Vsam?

Answer :

Accessing the facts is quicker and less difficult.
 VSAM helps more dataset types.
Supports kind of I/O Techniques.
Improves Efficiency.
Records can be accessed sequentially or randomly.
IBM - VSAM Interview Questions
Question three. What Are The Disadvantages Of Vsam?

Answer :

VSAM Datasets require extra garage space compared to different type of datasets due to Control statistics(CI) found in them.
VSAM can’t be saved in TAPE Volume i.E., VSAM Stored only in DASD.
VSAM is not a database like DB2, IMS DB & IDMS.
Question four. What Is Purpose Of Vsam?

Answer :

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

File Maker Tutorial
Question 5. What Is The Maximum Record Length For The Vsam Dataset?

Answer :

Max length of a report in VSAM is cylinder = 2880 bytes approx.

JCL Interview Questions
Question 6. What Is File Status In Vsam?

Answer :

The File STATUS clause of the FILE-CONTROL paragraph permits for each document to be related to afile popularity key (i.E., the two-person statistics item distinct within the FILE STATUS clause). If the FILE STATUS clause is designated for a given file, a cost indicating the popularity of every I/O operation against that record is positioned in the accociated document repute key. This fee is saved inside the report statuskey as quickly because the I/O operation is finished (and before execution of any EXCEPTION/ERROR declarative or INVALIDKEY/AT END word related to the I/O request).
Note: This detail might also behave differently when the CMPR2 compiler choice is used. The report statuskey is split into  repute keys: the primary person is known as report popularity key1; the second individual is document repute key 2.

Question 7. What Is The Length Of A Rdf?

Answer :

three Bytes

IBM DB2 Tutorial File Maker Interview Questions
Question eight. What Is The Length Of A Cidf?

Answer :

four Bytes

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

Answer :

32 KBytes (32 * 1024* eight)

IBM DB2 Interview Questions
Question 10. What Are The Different Types Of Vsam Files Available?

Answer :

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

COBOL Tutorial
Question eleven. What Is Idcams ?

Answer :

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

COBOL Interview Questions
Question 12. Can Ams Commands Be Run From The Tso Prompt ?

Answer :

Yes

IBM - VSAM Interview Questions
Question thirteen. 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 ?

Answer :

The most circumstance code generated is lower back because the circumstance code of the IDCAMS step.

IBM-JCL Tutorial
Question 14. What Is Control Interval, Control Area ?

Answer :

Control Interval has similarities 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 c programming language increases overall performance for sequential processing whilst the reverse is authentic for random get right of entry to. Under CICS whilst a file is locked, the whole CI gets locked. Control vicinity is a group of control periods. CA is used in the course of allocation. CA length is calculated based at the allocation type (cyl, tracks or records) and may be max of one cylinder.

Question 15. What Is Freespace ?

Answer :

Coded inside the DEFINE as FREESPACE(ci ca) where ci is the share of every manage c program languageperiod to be left unfastened for insertions, ca is the share of manipulate periods in every manipulate area to be left empty.

IBM-JCL Interview Questions
Question 16. How Do You Decide On Optimum Values For Ci, Freespace Etc..?

Answer :

CI length need to be based on document duration, type of processing. Usually CI is 4K. If document duration is larger(>1K), chose 6K or 8K. FREESPACE should be big if extra wide variety of insertions are envisaged. Usual values are (20,20) while heavy updates are anticipated. CI size can be calculated.

DB2 Using SQL Tutorial
Question 17. Would You Specify Freespace For An Esds?

Answer :

No. Because you can't insert statistics in an ESDS, additionally when you rewrite a report, it need to be of the same length. Thus placing any fee for freespace does not make any sense.

DB2 Using SQL Interview Questions
Question 18. What Is Shareopts ?

Answer :

SHAREOPTS is a parameter within the DEFINE and specifies how an item may be shared amongst users. It is coded as SHAREOPTS(a b), in which a is the pass region share choice ie; how  or extra jobs on a single system can share the file, whilst b is the go systemshare alternative ie how two or more jobs on exclusive MVSes can percentage the record. Usual fee is (2 3).

JCL Interview Questions
Question 19. What Is The Meaning Of Each Of The Values In Shareopts(2 3)?

Answer :

Value of 2 for pass area approach that the document can be processed concurrently with the aid of more than one users furnished simplest one in every of them is an updater. Value of three for cross system manner that any range of jobs can procedure the report for input or output (VSAM does nothing to make certain integrity).

IBM Mainframe Tutorial
Question 20. How Do You Define A Ksds ?

Answer :

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

IBM-JCL&VSAM Interview Questions
Question 21. What Happens When You Open An Empty Vsam File In A Cobol Program For Input?

Answer :

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

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

Answer :

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

IMS/DB Tutorial
Question 23. What Does A File Status Of 02 On A Vsam Indicate?

Answer :

Duplicate trade key . Happens on each enter and output operation.

IBM Mainframe Interview Questions
Question 24. What Is The Difference Between Sequential Files And Esds Files?

Answer :

Sequential(QSAM) documents can be created on tape even as ESDS files can not. Also, you could have ALTINDEX for an ESDS whilst no such facility exists for QSAM documents.

File Maker Interview Questions
Question 25. How Do You Load A Vsam Data Set With Records ?

Answer :

Using the REPRO command.

Question 26. How Do You Define A Gdg ?

Answer :

Use the DEFINE GENERATIONDATAGROUP command. In the same IDCAMS step, another dataset ought to be defined whose DCB parameters are used while new generations of the GDG are created. This dataset is referred to as the model dataset. The ds name of this model dataset need to be the same as that of the GDG, so use a disp of hold instead of catlg and additionally specify space=(trk,zero).

COBOL, CICS, JCL, VSAM, DB2 Interview Questions
Question 27. Do All Versions Of The Gdg Have To Be Of The Same Record Length ?

Answer :

No, the DCB of the version dataset may be overridden whilst you allocate new versions.

IBM DB2 Interview Questions
Question 28. How Are Different Versions Of Gdg Named ?

Answer :

base-document-name.GnnnnnV00 in which nnnn= era number (upto 255). Nnnn could be 0000 for the 1st generation.

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

Answer :

Use GDG call(-2).

Cisco Interview Questions
Question 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?

Answer :

Relative generation numbers are updated simplest on the stop of the job, no longer on the give up of a step. To allocate a new generation, we'd be using (+1) with a DISP of (NEW,CATLG,DELETE). To talk over with this in a subsequent step in the equal process, we would again use (+1) but with a DISP of SHR or OLD.

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

Answer :

Give (+1) because the generation number, give (new,catlg) for disp, provide space parameter, can provide the dcb parameter if you need to override the dcb of the version dataset.

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

Answer :

Use the LISTCAT command.

IMS/DB Interview Questions
Question 33. During Processing Of A Vsam File, Some System Error Occurs And It Is Subsequently Unusable .What Do You Do ?

Answer :

Run VERIFY.

COBOL Interview Questions
Question 34. If Fspc(a hundred one hundred) 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?

Answer :

No, they might not be left empty. One record could be written in every CI and 1 CI might be written for every CA.

Question 35. What Is A Base Cluste?

Answer :

The Index and information additives of a KSDS.

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

Answer :

1

IBM-JCL Interview Questions
Question 37. How Many Times Secondary Space Allocated?

Answer :

122 TIMES

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

Answer :

By USING RBA (Relative Byte Address).

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

Answer :

FREE SPACE ( FPSC )

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

Answer :

2 statistics buffers by means of default for ESDS. For KSDS it allots 2 statistics buffers and 1 index buffers. Each buffer is ready 4K.

DB2 Using SQL Interview Questions
Question 41. What Is An Alternate Index And Path?

Answer :

An exchange index is an every other way of gaining access to key sequenced statistics report stored in a base cluster and route is the linkage which connect exchange index to its base cluster.

Question forty two. Is A Delete Operation Possible In An Esds? B, Is Rewrite Operation Possible In Esds?

Answer :

No delete operation isn't viable in VSAM ESDS.B. Sure rewrite operation is feasible in an ESDS.

IBM-JCL&VSAM Interview Questions
Question forty three. What Is The Difference Between Lds And Esds?

Answer :

There  datasets are VSAM datasets. ESDS keeps manage statistics. But LDS does not keeps the manage facts.

Question 44. How To Delete A Member Using Jcl?

Answer :

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

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

Answer :

IDCAMS is an get entry to method services utility used for growing, deleting, changing VSAM documents and copying sequential file to a VSAM report, and so on.

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

Answer :

1) FROMADDRESS(address)
2) TOADDRESS(deal with) where 'address' specifies the RBA price of the important thing of the input record.
3) FROMNUMBER (rrn)
four)TONUMBER (rrn) wherein 'rrn' specifies the relative report variety of the RRDS file
five) FROMKEY (key)
6) TOKEY (key) where 'key' specifies the important thing of the enter record
7) SKIP (number)
eight) COUNT (quantity) where 'range' specifies the variety of records to bypass or reproduction Ex: REPRO INFILE(DD1) OUTFILE(DD2) SKIP(9000) COUNT(seven hundred)-Skips the first 9000 information and start copying at 9001 and copies 700 facts from DD1 to DD2.

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

Answer :

It divides a big dataset into numerous volumes in step with the Key degrees detailed. E.G. KEYRANGES ((0000001 2999999) (3000000 5999999)). If the hobby on the important thing levels are calmly distributed, concurrent get right of entry to is possible, that is a performance inprovement.

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

Answer :

It outline the move-vicinity and go-device sharing talents of the dataset. Syntax is SHR (Crvalue, CSvalue) cost 1 method a couple of study OR single write (read integrity ) 2 means multiple study AND single write ( Write integrity ) three approach Multiple study AND more than one write 4 is identical as 3, which refreshes the buffer with every random get admission to defualt is SHR(1 three).

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

Answer :

RECOVERY (default ) and SPEED are at the same time different. Recovery performats the control regions throughout the preliminary dataset load, if the task fails, you may restatt but you need to have a recovery ordinary already written to restart the job. SPEED does now not preformat the CAs. It is recommended that you specify SPEED to hurry up your preliminary facts load.

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

Answer :

Yes. Why? Because the trade key might first discover the number one key, which in flip locates the actual file. Needs twice the quantity of I/Os.

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

Answer :

255 - but you should be a nut to have so many ALT Indexes on a dataset !

Question fifty two. On Which Dataset You Can Have Alt Index?

Answer :

only on KSDS and ESDS - not RROS

Question fifty three. What Is The Meaning Of Vsam Return-code 28?

Answer :

Out of area situation is raised.

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

Answer :

Define new VSAM dataset allocated with extra area.
Use IDCAMS to REPRO the antique VSAM file to new VSAM dataset.
Use IDCAMS to ALTER / rename the old VSAM dataset or se IDCAMS to DELETE the antique VSAM datset.
Use IDCAMS to ALTER / rename the new VSAM dataset to the call of the authentic VSAM dataset.

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

Answer :

Run VERIFY.

Question 56. How Are Different Versions Of Gdg Named?

Answer :

base-file-name. GnnnnnnV00 wherein nnnn=era quantity (upto 255). Nnnn can be 0000 for the first era.

Question 57. How Do You Define A Gdg?

Answer :

Use the DEFINE GENERATIONDATAGROUP command. In the same IDCAMS step, some other dataset have to be described whose DCB parameters are used when new generations of the GDG are created. This dataset is called the version dataset. The DS name of this version dataset ought to be similar to that of the GDG, so use a disp of maintain rather than catlg and additionally specify space = (trk,0).

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

Answer :

UniqueCase: five + (alt-key-duration + primary - key )
Non unique Case: five + (alt-key-period + n * primary - key ) wherein n = range of replica facts for the exchange key.

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

Answer :

Using the REPRO command.

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

Answer :

No, the DCB of the version dataset may be overridden when you allocate new variations.

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

Answer :

Use GDG name(-2).

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

Answer :

Use the LISTCAT command.

Question sixty three. Using Alternate Indexes In Cics Program?

Answer :

FCT entires have to be created for both base cluster and the route. To read the use of the trade index, use the DD call of the direction in CICS document control instructions.

Question sixty four. Using Alternate Indexes In Batch Program?

Answer :

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

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

Answer :

LDS is a VSAM dataset in call only. It has unstructured 4k (4096 bytes ) fixed length CT's which do now not contain control fields and therefore from VSAM's viewpoint they do no longer comprise any logical facts. There isn't any free area, and no get right of entry to from Cobol. Can be accessed through DB2 and IMS rapid path datasets. LDS is essentially a table of records maintained on disk. The 'desk entries' must be created through a consumer application and can simplest be logically accessed through a user software. When handed, the whole LDS have to be mapped into storage, and then data is accessed via base and displacement type processing.

Question sixty six. What Is The Meaning Of The Define Model Parameter?

Answer :

It specifies whether or not Daniela Pestova or Yamila - oops! Wrong fashions! The MODEL parameter lets in you to model your cluster by means of modeling it after an existing cluster.

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

Answer :

They are DEFINE CLUSTER, DATA and INDEX.

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

Answer :

IDCAMS, the get right of entry to mehtod services software.

Question 69. What Is The Vsam-code Field?

Answer :

It is a COBOL II enhancement to VSAM batch processing expanding the FILE STATUS area. It is defined in WORKING-STORAGE as a six byte organization object with 3  byte elements, the ordinary return code, the characteristic code and the feedback code.

Question 70. What Is The Meaning Of Dynamic Processing?

Answer :

It's not often used. It way one software uses each sequential and random processing for a VSAM KSDS report.

Question 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?

Answer :

The most condition code generated is lower back because the condition code of the IDCAMS step.

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

Answer :

No. Because you can not insert information in an ESDS, also whilst you rewrite a report, it have to be of the equal duration. Thus placing any cost for FREESPACE does now not make any sense.

Question seventy three. What Is The Meaning Of Each Of The Values In Shareopts (2 three)?

Answer :

Value of 2 for move area way that the file may be processed simultaneously by means of multiple customers furnished best one among them is an updater. Value of 3 for cross device approach that any wide variety of jobs can method the document for input or output (VSAM does nothing to make certain integrity).

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

Answer :

DEFINE ALTERNATEINDEX. Important parameters are RELATE in which you specify the bottom cluster name, KEYS, RECORDSIZE, SHAREOPTION, UNIQUEKEY (or NONUNIQUEKEY), DATA (DS NAME for the records issue), INDEX(DS call for the index issue). Then DEFINE PATH. Important paramters are NAME (DS call for the direction). PATHENTRY (DS name of the alternate index name). UPDATE (or NOUPDATE) which specifies whether or not an ALT index is up to date whilst a replace to the vase cluster takes region. Then BLDINDEX. Paramters are INDATASET (DS name of base cluster), OUTDATASET (DS name of AIX).

Question seventy five. Name Some Common Vsam Error Conditions And Codes?

Answer :

They are end of document (10), reproduction key (22), record now not located (23), VSAM good judgment mistakes (ninety), open problem (92) and space hassle (ninety three).

Question 76. What Is A Vsam Slot?

Answer :

A relative document dataset (RRDS) consists of a special quantity of regions referred to as slots. Each slot is identified by means of a relative record variety (RRN) which suggests its relative position in the record.

Question seventy seven. There Are At Least Seven Idcams Commands Name And Explain Each Of Them?

Answer :

ALTER modifies statistics for a catalog, trade index, cluster or route. BLDINDEX builds the trade index, of direction. DEFINE is used for ALTERNATEINDEX, CLUSTER or PATH. DELETE gets rid of the catalog entry for a catalog, cluster, alternate index or route. LISTCAT lists data approximately the dataset. PRINT prints the dataset contents. REPRO copies data from one document to some other.

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

Answer :

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

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

Answer :

It should be opened as I/O.

Question eighty. What Is The Cobol Record Key Clause?

Answer :

The RECOED KEY in the SELECT clause identifies the documents number one key because it could be recognised to the program.

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

Answer :

The ORGANIZATION is INDEXED.

Question 82. What Is The Base Cluster?

Answer :

The base cluster includes the records factor and the index element for the number one index of a KSDS.

Question 83. What Is Free Space?

Answer :

Free space is reserved within the facts aspect of a KSDS to deal with inserting new facts.

Question eighty four. What Is A Path?

Answer :

A path is a record that allows you to get right of entry to a report by trade index - the path presents an affiliation between the AIX and the base cluster.

Question 85. What Is A Ci, Control Interval?

Answer :

A manage c program languageperiod is the unit of data that VSAM transfers between virtual and auxilliary garage.

Question 86. What Is A Ca, Control Area?

Answer :

A group of control durations makes up a manipulate vicinity.

Question 87. What Is The Index Set?

Answer :

This is the alternative part of the index. It has a couple of stages with recommendations that in the end attain to the sequence set.

Question 88. What Is The Catalog?

Answer :

The catalog consists of the call of all datasets. VSAM and non-VSAM. It is used to get right of entry to these datasets.

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

Answer :

The FILE STATUS discipline identifies the sector that VSAM uses to offer facts approximately every I/O operation for the file.

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

Answer :

ACCESS can be SEQUENTIAL, RANDOM or DYNAMIC.

Question ninety one. Do Primary Key Values Have To Be Unique? Do Alternate Key Values Have To Be Unique?

Answer :

Primary key values ought to be precise; change key values need not be.

Question ninety two. What Is A Vsam Split?

Answer :

If there is not sufficient space inside the control c program languageperiod VSAM plays a manipulate c program languageperiod cut up by means of transferring some records to the unfastened manipulate intervals. If there isn't always a free manage c language VSAM performs a manipulate place split by using allocating a brand new manipulate location and moving 1/2 of the manage durations to it.

Question ninety three. What Is The Upgrade Set?

Answer :

The improve set is the listing of all AIXes that VSAM must preserve for a selected base cluster, so that after statistics within the base cluster is updated, the AIX documents also are updated.

Question ninety four. What Is An Alternate Index?

Answer :

An AIX is a document that lets in access to a VSAM dataset with the aid of a key other than the primary one.

Question 95. What Is A Cluster?

Answer :

A cluster is the combination of the index, collection set and facts quantities of the dataset. The operating system gives application access to the cluster, ie; to all components of the dataset simultaneously.

Question ninety six. What Is A Sequence Set?

Answer :

This is the a part of the index that factors to the CA and CI of the document being accessed.

Question ninety seven. What Are The Distinctive Features Of A Ksda, Key Sequenced Dataset?

Answer :

The index and the distributed loose area.

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

Answer :

They are stored without respect to the contents of the facts and in the order in which they're blanketed in the report.

Question 99. What Are The Types Of Vsam Datasets?

Answer :

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

Question one hundred. Syntax Of Ams Modal Commands?

Answer :

Note: those may be used handiest under IDCAMS and not from the TSO set off.

IF LASTCC(or MAXCC) >(or <,= etc..) fee -
THEN -
DO -
command set (which includes DELETE, DEFINE and so on..)
ELSE -
DO -
command set.

LASTCC - Condition code from the final function(along with delete) finished.
MAXCC - Max condition code that changed into again by way of any of the prev capabilities.
SET is likewise a legitimate AMS command. SET LASTCC (or MAXCC) = cost.
The maximum condition code is 16. A cond code of 4 indicates a warning. A cond code of eight is generally encountered on a DELETE of a dataset that isn't present.




CFG