YouTube Icon

Interview Questions.

Top 100+ Ibm - Vsam Interview Questions And Answers - May 31, 2020

fluid

Top 100+ Ibm - Vsam Interview Questions And Answers

Question 1. What Is An Alternate Index ?

Answer :

An change index is some other record associated with the cluster, but looked after using an exchange key which could have duplicates.

Question 2. How Do You Create An Alternate Index ?

Answer :

You use the IDCAMS application with the DEFINE AIX option once you construct the cluster after which do every other IDCAMS with the BLDINDEX choice to populate the alternate index.

Change Management Interview Questions
Question 3. What Parameter In The Define Aix Option Is Used To Determine The Maximum Number Of Duplicate Keys Allowable ?

Answer :

The RECORDSIZE parameter. There are 2 numbers that follow this: the 1st is the common and the 2nd is the maximum. The values are same to five + (cluster key length) + N*(alternate key duration), where N is the allowable range of duplicates.

Question four. Name A Few Common Vsam Status Codes?

Answer :

00-OK
02-READ a reproduction exchange key
10-end of report reached whilst doing a READ
22-looking to WRITE a duplicate primary key
23-report not observed whilst doing a READ
97-record integrity validated, do an IDCAMS VERIFY

Change Management Tutorial
Question five. What Is Buffering And How Does It Apply To Vsam Files ?

Answer :

When big blocks of records are used, more essential garage is required than whilst smaller blocks are used, but large blocks keep CPU time and disk space. Additionally, greater buffers may additionally keep elapsed time because the software does not must watch for an I/O to complete for it to continue processing.

In the JCL, you specify BUFNI (number of index buffers) and BUFND (variety of statistics buffers) as sub parameters of the AMP parameter.

For random get entry to, the BUFNI is one more than the variety of index ranges and a BUFND of 2 is first-rate.

For sequential get right of entry to, a BUFNI of 1 and at the very least five for BUFND is exceptional.

For dynamic get entry to, the values of every is the higher of the numbers for both random or sequential.

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

Answer :

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

Question 7. What Is Idcams ?

Answer :

IDCAMS is the Access Method Services software. You run the IDCAMS application and deliver AMS commands via SYSIN. (examples of AMS commands are DELETE, DEFINE, REPRO and many others..).

IBM DB2 Tutorial COBOL Interview Questions
Question 8. Can Ams Commands Be Run From The Tso Prompt ?

Answer :

Yes

Question nine. Syntax Of Ams Modal Commands ?

Answer :

Note: those may be used best below IDCAMS and now not from the TSO set off.

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.

IBM-JCL Interview Questions
Question 10. 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 maximum condition code generated is returned as the condition code of the IDCAMS step.

COBOL Tutorial
Question 11. What Is Control Interval, Control Area ?

Answer :

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

IBM-JCL&VSAM Interview Questions
Question 12. What Is Freespace ?

Answer :

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.

Change Management Interview Questions
Question 13. How Do You Decide On Optimum Values For Ci, Freespace Etc..?

Answer :

CI size should be based on record length, type of processing. Usually CI is 4K. If record length is larger(>1K), pick 6K or 8K.

FREE SPACE have to be large if extra quantity of insertions are envisaged. Usual values are (20 20) whilst heavy updates are expected. CI size can be calculated.

IBM-JCL Tutorial
Question 14. Would You Specify Freespace For An Esds?

Answer :

No. Because you can't insert records in an ESDS, also whilst you rewrite a record, it need to be of the equal duration. Thus setting any cost for freespace does not make any experience.

Question 15. What Is Shareopts ?

Answer :

SHAREOPTS is a parameter inside the DEFINE and specifies how an object may be shared among customers. It is coded as SHAREOPTS(a b), wherein a is the cross area percentage option ie how  or greater jobs on a unmarried machine can proportion the report, whilst b is the cross system share choice ie how two or extra jobs on exceptional MVSes can percentage the file. Usual value is (2 3).

IBM Mainframe Interview Questions
Question 16. What Is The Meaning Of Each Of The Values In Shareopts(2 3)?

Answer :

Value of 2 for cross vicinity way that the record can be processed simultaneously by means of multiple customers provided only one of them is an updater. Value of 3 for move gadget manner that any number of jobs can process the file for input or output (VSAM does not anything to make sure integrity).

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

Answer :

DEFINE CLUSTER(cluster call) with the INDEXED parameter. Also specify the ds call for the DATA component & the ds INDEX component. Other crucial parms are RECORDSIZE, KEYS, SHARE OPTIONS.

Cisco Interview Questions
Question 18. How Do You Define An Altindx ? How Do You Use Altindxs In Batch, Cics Pgms ?

Answer :

DEFINE ALTERNATEINDEX. Important paramters are RELATE where you specify the bottom cluster name, KEYS, RECORDSIZE, SHAREOPTIONS,UNIQUEKEY(or NONUNIQUEKEY), DATA(ds call for the statistics factor), INDEX(ds call for the index issue).

Then DEFINE PATH. Important paramters are NAME (ds call for the course), PATHENTRY (ds call of the alternate index name), UPDATE(or NOUPDATE) which specifies whether an alt index is up to date when a replace to the bottom cluster takes place.

Then BLDINDEX. Parameters are INDATASET(ds name of base cluster), OUTDATASET(ds call of AIX).

Using trade indexes in batch pgms:

In the JCL, you must have DD stmts for the cluster and for the path(s). In the cobol pgm, SELECT .. ASSIGN TO ddname for base cluster RECORD KEY IS... ALTERNATE RECORD KEY IS..

Using alternate indexes in CICS pgms:

FCT entries need to be created for both base cluster & the course. To read the use of the alternate index, use the dd name of the path in CICS record manipulate commands.

IBM DB2 Interview Questions
Question 19. What Happens When You Open An Empty Vsam File In A Cobol Program For Input?

Answer :

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

IMS/DB Tutorial
Question 20. How Do You Initialize A Vsam File Before Any Operation? A Vsam With Alternate Index?

Answer :

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

IMS/DB Interview Questions
Question 21. What Does A File Status Of 02 On A Vsam Indicate?

Answer :

Duplicate trade key . Happens on each enter and output operation

Question 22. How Do You Calculate Record Size Of An Alternate Cluster? Give Your Values For Both Unique And Non-specific.

Answer :

Unique Case: 5 + ( alt-key-length + number one-key )
Nonunique Case: 5 + ( alt-key-period + n * number one-key )
wherein n = # of duplicate statistics for the alternate key
????Any one that is aware of - can you provide an explanation for ?

Question 23. What Is The Difference Between Sequential Files And Esds Files?

Answer :

Sequential(QSAM) files can be created on tape while ESDS files can't.

Also, you may have ALTINDEX for an ESDS even as no such facility exists for QSAM documents.

Mainframe DB2 Interview Questions
Question 24. How Do You Load A Vsam Data Set With Records ?

Answer :

Using the REPRO command.

COBOL Interview Questions
Question 25. How Do You Define A Gdg ?

Answer :

Use the DEFINE GENERATIONDATAGROUP command. In the equal IDCAMS step, any other dataset need to 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 need to be similar to that of the GDG, so use a disp of hold as opposed to catlg and also specify area=(trk,zero)

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

Answer :

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

Question 27. How Are Different Versions Of Gdg Named ?

Answer :

base-file-name.GnnnnnV00 wherein nnnn= generation number (upto 255).

Nnnn may be 0000 for the 1st era.

IBM-JCL Interview Questions
Question 28. Suppose three Generations Of A Gdg Exist. How Would You Reference The 1 St Generation In The Jcl?

Answer :

Use GDG name(-2).

Question 29. 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 handiest on the stop of the task, not at the cease of a step. To allocate a new technology, we might be the usage of (+1) with a DISP of (NEW,CATLG,DELETE). To confer with this in a next step inside the same activity, we might once more use (+1) but with a DISP of SHR or OLD.

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

Answer :

Give (+1) because the era wide variety, give (new,catlg) for disp, deliver space parameter, can give the dcb parameter in case you want to override the dcb of the version dataset.

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

Answer :

Use the LISTCAT command.

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

Answer :

Run VERIFY.

Question 33. What Is Idcams?

Answer :

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

IBM-JCL&VSAM Interview Questions
Question 34. Can Ams Commands Be Run From The Tso Prompt?

Answer :

Yes

Question 35. Syntax Of Ams Modal Commands?

Answer :

Note: those can be used only under IDCAMS and no longer from the TSO activate.

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.

Question 36. 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 maximum condition code generated is returned as the condition code of the IDCAMS step.

IBM Mainframe Interview Questions
Question 37. What Is Control Interval, Control Area?

Answer :

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

Question 38. What Is Freespace?

Answer :

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.

Question 39. How Do You Decide On Optimum Values For Ci, Freespace Etc?

Answer :

CI size should be based on record length, type of processing. Usually CI is 4K. If record length is larger(>1K), choose 6K or 8K.

FREESPACE have to be huge if more range of insertions are envisaged. Usual values are (20 20) whilst heavy updates are anticipated. CI size can be calculated.

Question 40. What Is Shareopts?

Answer :

SHAREOPTS is a parameter inside the DEFINE and specifies how an item may be shared amongst customers. It is coded as SHAREOPTS(a b), where a is the cross location share choice ie how  or extra jobs on a single machine can percentage the record, at the same time as b is the move system percentage option ie how two or greater jobs on unique MVSes can percentage the document. Usual value is (2 3).

Cisco Interview Questions
Question forty one. How Do You Define A Ksds?

Answer :

DEFINE CLUSTER(cluster call) with the INDEXED parameter. Also specify the ds name for the DATA element & the ds INDEX aspect. Other critical parms are RECORD SIZE, KEYS, SHARE OPTIONS.

Question forty two. How Do You Define An Altindx ? How Do You Use Altindxs In Batch, Cics Pgms?

Answer :

DEFINE ALTERNATEINDEX. Important parameters are RELATE wherein you specify the bottom cluster name, KEYS, RECORDSIZE, SHAREOPTIONS, UNIQUEKEY (or NONUNIQUEKEY), DATA(ds name for the information element), INDEX(ds call for the index aspect).

Then DEFINE PATH. Important paramters are NAME (ds call for the route), PATHENTRY (ds name of the exchange index name), UPDATE(or NOUPDATE) which specifies whether an alt index is updated while a replace to the base cluster takes region.

Then BLDINDEX. Parameters are INDATASET(ds call of base cluster), OUT DATASET(ds name of AIX).

Using change indexes in batch pgms:

In the JCL, you ought to have DD stmts for the cluster and for the route(s). In the cobol pgm, SELECT .. ASSIGN TO ddname for base cluster RECORD KEY IS... ALTERNATE RECORD KEY IS..

Using change indexes in CICS pgms:

FCT entries must be created for each base cluster & the direction. To study the usage of the exchange index, use the dd name of the course in CICS record manipulate instructions.

IMS/DB Interview Questions
Question forty three. What How Do You Initialize A Vsam File Before Any Operation? A Vsam With Alternate Index?

Answer :

Can write a dummy application that simply opens the report for output & then closes it.

Question forty four. What Are The Types Of Vsam Datasets?

Answer :

Entry sequenced dataset (ESDS), key sequenced statistics sets (KSDS) and relative report dataset (RRDS).

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

Answer :

It have to be opened as I/O.

Question 46. What Is File Status In Vsam?

Answer :

The File STATUS clause of the FILE-CONTROL paragraph permits for each record to be related to a record popularity key (i.E., the 2-character records object distinct in the FILE STATUS clause). If the FILE STATUS clause is distinctive for a given file, a price indicating the reputation of every I/O operation against that report is positioned within the associated record repute key. This price is stored in the document repute key as quickly as the I/O operation is completed (and earlier than execution of any EXCEPTION/ERROR declarative or INVALID KEY/AT END phrase related to the I/O request).

Note: This element can also behave in a different way whilst the CMPR2 compiler choice is used. The record popularity key's divided into  fame keys: the primary character is called file popularity key1; the second character is record repute key 2.

Question forty seven. What Are The Different Types Of Vsam Files Available? Explain Them

Answer :

Virtual Storage Access Method(VSAM) is a disk storage machine.

It become applied in OS/VS2 operating machine.

Subsequently, it changed into used via out the MVS architecture.

VSAM comprises of the following access methods:

ESDS: Entry Sequence Data Set

KSDS: Key Sequence Data Set

RRDS: Relative Data Set

VSAM records can be of constant or variable period.

These are prepared in fixed size blocks, known as Control Intervals, and later into large divisions known as Control Areas.

CI sizes are measured in terms of bytes, while CA sizes are measured in phrases of disk tracks or cylinders.

ESDS : It carries the documents which can be interface specific and

accessed via Relative Byte Address

KSDS : It includes the files that are interface unique and accessed through a secondary index

RRDS : It contains the documents that are interface specific and accessed via Relative Record Number

Each report has  objects.

File object - represents the file itself. The techniques of the file are used to perform
DELETE,READ,REWRITE,UNLOCK,WRITE,STARTBR operations.
FileBrowse item - represents a browse operations on the record and the strategies are used to carry out
ENDBR,READNEXT,READPREV,RESETBR
Question 48. What Is The Syntax Of Ams Modal Commands?

Answer :

The following is the syntax of AMS modal commands:

IF LASTCC(or MAXCC) >(or <,= etc..) fee -
THEN -
DO -
command set (like DELETE, DEFINE and many others..)

ELSE -
DO -
command set

in which

LASTCC - Condition code from the ultimate function(along with delete) executed

MAXCC - Max condition code that changed into again via any of the prev functions

SET is likewise a valid AMS command. SET LASTCC (or MAXCC) = cost

PS: These can be used most effective beneath IDCAMS and not from the TSO spark off.

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

Answer :

Issue the command DEFINE ALTERNATEINDEX. Important parameters are RELATE in which the database cluster name is particular. KEYS, RECORDSIZE,SHAREOPTIONS,UNIQUEKEY(or NONUNIQUEKEY) DATA(data source name for the records component), INDEX(information supply call for the index component).
Then trouble the command DEFINE PATH. Important parameters are NAME (statistics source call for the direction), PATHENTRY (records source call of the alternate index call), UPDATE or NOUPDATE, that specifies the willpower of alt index is updated while an update to the database cluster takes place
Then trouble the command BLDINDEX. Important parameters are INDATASET (data supply call of base cluster), OUTDATASET(statistics supply call of AIX).
Using change indexes in batch programs:

JCL, has DD statements for cluster and for paths.

For the COBOL program :

The command SELECT ASSIGN TO ddname For the bottom cluster RECORD KEY IS...... ALTERNATE RECORD KEY IS… used

Using alternate indexes in CICS programs:

The introduction of FCT entries are obligatory for both cluster and the path

Utilize the dd call of the route in CICS report manipulate instructions, by using the exchange index

Question 50. We Can Define The Ksds Cluster By Two Ways By Using The File-aid Or By Using The Idcams Utility. Explain Them.

Answer :

KSDS cluster may be defined via

-Using the record-resource
-or by using IDCAMS software:

The document can be described with average length of a hundred and maximum duration of a hundred and fifty, in IDCAMS, with key period 10 beginning at 0.

The following instance illustrates :

//step01 EXEC pgm=IDCAMS
//SYSIN DD *
DEFINE CLUSTER(NAME(userid.Name.Sample) -
VOLUMES(MVS801) -
RECORDSIZE(a hundred one hundred fifty) -
TRACKS(10 20)
KEYS(10 0) -
INDEXED ) -
DATA ( NAME(userid.Call.Sample.Facts)) -
INDEX( NAME(userid.Name.Pattern.Index)) - 
/*
//
Question 51. How Do You Convert Flat Files To Vsam Files?

Answer :

Flat documents are converted into VSAM documents by using following technique:

 Identify the primary key, whilst the entire document may be number one key.
 Alternate key also can be used, if needed
 File is to be taken care of by means of number one key or the whole report
 Utilize the SORT assertion for dropping duplicates.
 A JCL command ( IDCAMS – Define Cluster) want to be submitted by way of the usage of the result of sorting mechanism(noted above) as enter
 Use the command IDCAMS REPRO for loading the flat report into the VSAM record.
 

Question 52. How Did You Refresh A Vsam File And How Frequently You Do It ?

Answer :

Refresh can be completed on every day or weekly or monthly foundation
Refreshing refers to DELETE / DEFINE the VSAM file
Step 1: Deleting the present VSAM document:

IF LASTCC =eight ; SET MAXCC=zero

Step 2: DEFINE VSAM-FILE(COND=(0,LT,STEP1)

Return-code = 8 while the document that is trying to delete does not exist.

Utilize the command VERIFY in TSO

Question fifty three. Explain The Information Contained In Ci

Answer :

Control statistics includes Record Descriptor Field and Control Interval Descriptor Field.
Each CI contains one CIDF that includes the final 4 bytes
CIDF includes statistics about the offset and length of unfastened space inside the CI
In case of fixed length facts, every CI carries 2 RDFs each RDF is of 3 bytes length
In case of variable length size data, there can be a separate RDF for every record in the CI.
The records portion of the CI must be within the multiples of 512 bytes / 2048 bytes.
The maximum length of the CI is 32 KB. - The length of index portion of CI may be any of these
512, 1024,2048,4096
Question 54. Explain The Differences Between Vsam And Non-vsam Files

Answer :

The AMS program is used for introduction of VSAM files - ISPF panel or a widespread JCL is used for advent of a NON-VSAM dataset.
The VSAM statistics is stored in catalogs - The NON-VSAM facts is saved in VTOC as dataset labels
The information set corporation in VSAM documents are Key sequenced, Entry sequenced and Relative report statistics units
A records set is a physical records that are saved on a disk or tape , is a collection with a completely unique name

The information set is normally diagnosed by the MVS with labels

The label records need to be supplied in JCL

The information set corporation in NON-VSAM files are sequenced, Indexed Sequential, Direct and partitioned

Question fifty five. Difference Between Vsam And Database Tables

Answer :

VSAM file can't run SQL queries. -VSAM lacks any sort of relation -VIEWS and SYNONYMS can't be defined on VSAM documents -RDBMS ideas can't be applied in VSAM files.
SQL queries can be run in database desk - Data fetching is more green than VSAM files - RDBMS principles are relevant in DB2 database - ALIAS VIEWS can be defined on tables for sharing customized statistics.
Question 56. What Is Meant By Dirty Read In Vsam?

Answer :

High degree of concurrent get admission to to VSAM documents is finished by using grimy study - It is achieved by using fending off the headaches associated with CI and CA splits - The grimy examine protocol is summarized as:
The VSAM record mandatorily be defined with cross-area SHARE POINTS four. - The record allocation ought to be with DISP=SHR - ENQ need to be followed for all operations of the documents, for information set - Data set call is detailed for ENQ name - Any string can be used for the ENQ gname - The user’s buffer must be refreshed with GET request, after obtaining a lock - No lock is held at some point of a wait - DEQ feature have to be called on the quit of all of the document operations of enqueue.
Question fifty seven. What Are The Idcams Commands That Can Be Used For Vsam And Explain Each Of Them.

Answer :

To regulate the data for a catalog, change index, cluster or a route, ALTER command is used
DEFINE command is used for ALTERNATE INDEX, CLUSTER or PATH
DELETE command is used for doing away with the catalog for a catalog, cluster, trade index or course
LISTCAT command lists the information about the dataset.
PRINT command prints the contents of dataset - REPRO command is used to copy the statistics from one document to any other.
Question fifty eight. What Is The Purpose Of The Verify Function Of Idcams?

Answer :

To re-sync the quit of the record facts with the catalog facts, the VERIFY feature is used.




CFG