Mainframe Interview Questions

COBOL:


1.What happens when the ON SIZE ERROR phrase is specified on a COMPUTE statement?

If the condition occurs, the code in the ON SIZE ERROR phrase is performed, and the content of the destination field remains unchanged. If the ON SIZE ERROR phrase is not specified, the assignment is carried out with truncation. There is no ON SIZE ERROR support for the MOVE statement.

2. What is difference between next sentence and continue?

NEXT SENTENCE gives control to the verb following the next period. CONTINUE gives control to the next verb after the explicit scope terminator. (This is not one of COBOL II's finer implementations). It's safest to use CONTINUE rather than NEXT SENTENCE in COBOL II. CONTINUE is like a null statement (do nothing) , while NEXT SENTENCE transfers control to the next sentence (!!) (A sentence is terminated by a period). Check out by writing the following code example, one if sentence followed by 3 display statements: If 1 > 0 then next sentence end if display 'line 1' display 'line 2'. display 'line 3'.
*** Note- there is a dot (.) only at the end of the last 2 statements, see the effect by
replacing Next Sentence with Continue ***

3. PIC S9(4)COMP IS USED INPSPITE OF COMP-3 WHICH OCCUPIES LESS SPACE.WHY?

S9(4) COMP uses only 2 bytes. 9(4) COMP-3 uses 3 bytes. 3 bytes are more than 2 bytes. Hence COMP is preferred over COMP-3 in this case.

4. Which picture clause will you use to define a hexadecimal item in a VALUE clause?

01 ws-hexitem PIC X(2) value X'020C'.
01 ws-hex redefines PIC S9(3) comp-3.

5. How many subscripts or indexes are allowed for an OCCURS clause?

7 subscripts or indexes are allowed.

6. Why cannot Occurs be used in 01 level?
Because, Occurs clause is there to repeat fields with the same format, but not the records.

7. Can a REDEFINES clause be used along with an OCCURS clause?
Yes, if the REDEFINES clause is subordinate to OCCURS clause.


8. What is the default value(s) for an INITIALIZE and what keyword allows for an override of the default.

INITIALIZE sets spaces to alphabetic and alphanumeric fields. Initialize sets Zeroes to numeric fields. FILLER, OCCURS DEPENDING ON items are left untouched. The REPLACING option can be used to override these defaults.

9. What is the function of a delimiter in UNSTRING?

A delimiter when encountered in the sending field causes the current receiving field to be switched to the next one indicated.

10. When is a scope terminator mandatory?

Scope terminators are mandatory for in-line PERFORMS and EVALUATE statements. For readability, it's recommended coding practice to always make scope terminators explicit.

11. Which clause can be used instead of checking for FILE STATUS = 10?

FILE STATUS 10 is the end of file condition. Hence AT END clause can be used.

12. What are the causes for S0C1, S0C4, S0C5, S0C7, S0CB abends?

S0C1 - May be due to 
1.Missing or misspelled DD name 
2.Read/Write to unopened dataset
3.Read to dataset opened output
4.Write to dataset opened input
5.Called subprogram not found.

S0C4 may be due to 
1.Missing Select statement(during compile) 
2.Bad Subscript/index
3.Protection Exception 
4.Missing parameters on called subprogram 
5.Read/Write to unopened file 
6.Move data from/to unopened file.

S0C5 May be due to 
1.Bad Subscript/index 
2.Close an unopen dataset 
3.Bad exit from a perform 
4.Access to I/O area(FD) before read.

S0C7 may be due to 
1.Numeric operation on non-numeric data 
2.Un-initialize working-storage
3.Coding past the maximum allowed sub script.

S0CB may be due to 
1.Division by Zero

13. What is the difference between a SEARCH and a SEARCH ALL statement?
The first is a sequential search, the second is a binary search

14. What is the difference between a subscript and an index in a table definition?
A subscript is a working storage data definition item, typically a PIC (999) where a value must be moved to the subscript and then incremented or decremented by ADD TO and SUBTRACT FROM statements. An index is a register item that exists outside the program's working storage.You SET an index to a value and SET it UP BY value and DOWN BY value.

15.  The maximum number of dimensions that an array can have in COBOL-85 is ________.
SEVEN in COBOL - 85 and THREE in COBOL - 84

16. How is PIC 9.99 is defferent from PIC 9v99?
PIC 9.99 is a four position field that actually contains a decimal point where as 9v99 is a three position numeric field with an implied or assumed decimal point.

17. What is the maximum length of a field you can define using COMP-3?
10 Bytes (S9(18) COMP-3).

18. How do we get current date from system with century?
By using Intrinsic function, FUNCTION CURRENT-DATE

19. What divisions,sections and paragraphs are mandatory for a COBOL program?
IDENTIFICATION DIVISION and PROGRAM-ID paragraph are mandatory for a compilation error free COBOL program.

20. Name the divisions in a COBOL Program:
1. IDENTIFICATION DIVISION.
2. ENVIRONMENT DIVISION.
3. DATA DIVISION
4. PROCEDURE DIVISION.

21. What are the different data types available in COBOL?
Alpha-numeric (X)
Alphabetic (A)
Numeric (9).

22. What is 77 level used for?
Elementary level item. Cannot be sub division of other items, nor they can be subdivided themselves.

23. What is 88 level used for?
For condition names.

24. What is 66 level used for?
For RENAMES clause.

25. What does the IS NUMERIC clause establish?
IS NUMERIC can be used on alphanumeric items, signed numeric, packed decimal items and unsigned numeric items. IS NUMERIC returns TRUE if the item only consists of 0 - 9. However if the item being tested is a signed item, then it may return 0-9, + and -.

26. Can the OCCURS clause be at the 01 level?
No.

27. My program has an array defined to have 10 items. due to a bug, I find that even if the program access the 11th item in this array, the program does not abend. What is wrong with it?

Must use compiler option SSRANGE if you want array bounds checking. Default is NOSSRANGE.

28. Can I redefine an X(200) field with a field of X(100)?
Yes.

29. How is sign stored in Packed Decimal fields and Zoned decimal fields?
Packed Decimal field:
Sign is stored as a hex value in the last nibble(4 bits) of the storage.
Zoned Decimal field:
As a default, sign is over punched with the numeric value stored in the last bit.

30. How is sign stored in COMP field?
In the most significant bit. Bit is ON if -ve. OFF if +ve.


JCL:

1. How many levels of nesting is allowed in PROCs?

15.

2. If the "DISP=" keyword is not coded for an existing dataset, what default values will be used for DISP="?
 If the "DISP=" keyword is not coded ,then the DEFAULT Values are : DISP=(NEW,DELETE,DELETE)

3. What does COND=ONLY mean?
It means that job step will be executed only if previous steps abnormally terminates.

4. What does COND=EVEN mean?
It means that job step will be executed even if one of the previous steps abnormally terminates.

5. Can you execute a PROC from another PROC?
Yes. Only if cataloged in SYS1.PROCLIB. Upto 15 levels are allowed.

6. How do you restart a step in JCL?
Use RESTART=step name.

7. How do you pass parameters to the program as the job is being executed ?
By using 'parm' parameter in exec statement. the value mentioned here should be declared in linkage section in the program and process through procedure division. This technique is very useful when you do not know the parameters at the time of coding the programs.

8. Why do you use a control card?
A controlcard can be a member of a pds or a sequential dataset and is used
for storing the date fields, Definitions of VSAM files....etc. You use controlcard because you cannot use a instream procedure in a procedure.Generally you will be calling a Proc from your Jcl and you cannot code instream procedure in the Proc and so you will point to the dataset which is called controlcard.

9. What is the parameter to be passed in the job card for the unlimited time, irrespective of the job class?
TIME=1440

10. What is the purpose of include statement in a JCL?
It is used as an alternative for steplib.When we specify the dataset name in include ,it will search in all the datasets specified in the include dataset.

11. What 3 guidelines do we have to follow when concatenating DD statements?
1. Datasets must be of the same type (disk or tape).
2. All datasets must have the same logical record length.
3. The dataset with the largest blocksize must be listed first.

12. What is the difference between specifying DISP=OLD and DISP=SHR for a dataset?
OLD specifies exclusive use of a dataset, SHR allows multiple jobs to concurrently access the dataset.

13. What does SYSIN * indicate?
Instream data follows this card and is terminated when followed by a card containing // or /* in columns 1 and 2.

14. What are the three basic types of statements in a jobstream?
JOB(one per jobstream)EXEC(one or more per job)DD(one or more per jobstep).

15. What is primary allocation for a dataset?
The space allocated when the dataset is first created.

16. What is the difference between primary and secondary allocations for a dataset?
Secondary allocation is done when more space is required than what has already been allocated.

17. What does a disposition of (NEW,CATLG,DELETE) mean?
That this is a new dataset and needs to be allocated, to CATLG the dataset if the step is successful and to delete the dataset if the step abends.

18. What does a disposition of (NEW,CATLG,KEEP) mean?
That this is a new dataset and needs to be allocated, to CATLG the dataset if  the step is successful and to KEEP but not CATLG the dataset if the step abends. Thus if the step abends, the dataset would not be catalogued and we would need to supply the vol. ser the next time we refer to it.

19. How do you access a file that had a disposition of KEEP?
Need to supply volume serial no. VOL=SER=xxxx.

20. What does a disposition of (MOD,DELETE,DELETE) mean ?
The MOD will cause the dataset to be created (if it does not exist), and then the two DELETE 's will cause the dataset to be deleted whether the step abends or not.This disposition is used to clear out a dataset at the beginning of a job.

21. How do you check the syntax of a JCL without running it?
TYPERUN=SCAN on the JOB card or use JSCAN.

22. What does IEBGENER do?
Used to copy one QSAM file to another. Source dataset should be described using SYSUT1 ddname. Destination dataset should be described using SYSUT2. IEBGENR can also do some reformatting of data by supplying control cards via SYSIN.

23. I have a COBOL program that ACCEPT 's some input data. How do you code the JCL statement for this? (How do you code in-stream data in a JCL?)

//SYSIN DD*
input data
/*

24.  What is STEPLIB, JOBLIB? What is it used for?
Specifies that the private library (or libraries) specified should be searched before the default system libraries in order to locate a program to be executed. STEPLIB applies only to the particular step, JOBLIB to all steps in the job.

25. What is order of searching of the libraries in a JCL?
First any private libraries as specified in the STEPLIB or JOBLIB, then the system libraries such as SYS1.LINKLIB. The system libraries are specified in the linklist.

26. What happens if both JOBLIB & STEPLIB is specified ?
JOBLIB is ignored.

27. What is a GDG? How is it referenced? How is it defined?
GDG stands for generation data group. It is a dataset with versions that can be referenced absolutely or relatively. It is defined by an IDCAMS define generation datagroup execution.

28. What is the purpose and meaning of the TIME keyword and what JCL statement is it associated with?
TIME specifies the maximum CPU time allocated for a particular job or job step. If TIME is in the JOB card, it relates to the entire job; if in the EXEC statement, it relates to the job step.

29. How is the keyword DUMMY used in JCL
For an output file DUMMY specifies that the output is to be discarded. For input it specifies that the file is empty.

30. What does the keyword DCB mean and what are some of the keywords associated with it?
DCB stands for data control block; it is a keyword for the DD statement used to describe datasets. Keywords associated with it are BLKSIZE, DEN, LRECL and RECFM.

VSAM:

1. What are the types of VSAM datasets?

Entry sequenced datasets (ESDS)
Key sequenced datasets (KSDS)
Relative record dataset (RRDS).

2. 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.

3.What is a CI, control interval?
A control interval is the unit of information that VSAM transfers between virtual and auxiliary storage.

4. What is a CA, control area?
A group of control intervals makes up a control area.

5. What is a sequence set?
This is the part of the index that points to the CA and CI of the record being accessed.

6. What are the distinctive features of a KSDS, Key Sequenced dataset?
The index and the distributed free space.

7. 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.

8. What is a cluster?
A cluster is the combination of the index, sequence set and data portions of the dataset. The operating ystem gives program access to the cluster, ie. to all parts of the dataset simultaneously.

9. What is the catalog?
The catalog contains the names of all datasets, VSAM and non-VSAM. It is used to access these datasets.

10. 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.

11. 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.

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

13. 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.

14. What is the base cluster?
The base cluster consists of the data component and the index component for the primary index of a KSDS.

15. 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.

16. In the COBOL SELECT statement what is the ORGANIZATION for a KSDS?
The ORGANIZATION is INDEXED.

17. In the COBOL SELECT statement for a KSDS what are the three possibilities for ACCESS?
ACCESS can be SEQUENTIAL, RANDOM or DYNAMIC.

18. What is the COBOL RECORD KEY clause?
The RECORD KEY in the SELECT clause identifies the files primary key as it will be known to the program.

19. 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.

20. If you wish to use the REWRITE command haw must the VSAM file be opened?
It must be opened as I/O.

21. Explain the meaning and syntax for the START command.
The START command is used read other than the next VSAM record. A value must be moved into the RECORD KEY. The KEY clause is optional, but it can be used to specify a relational (equal, less than, etc.) operator.

22. 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.

23. Name some common VSAM error conditions and codes.
End of file (10)
Duplicate key (22)
Record not found (23)
VSAM logic error (90)
Open Problem (92)
Space Problem (93)

24. 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.

25. What is the utility program closely associated with VSAM?
IDCAMS, the access method services utility.

26. There are at least seven IDCAMS commands; name and explain each of them.
1. ALTER - modifies information for a catalog, alternate index, cluster or path.
2. BLDINDEX - builds the alternate index
3. DEFINE - used for ALTERNATEINDEX, CLUSTER or PATH.
4. DELETE - removes the catalog entry for a catalog, cluster, alternate index or path.
5. LISTCAT - lists information about the dataset.
6. PRINT - prints the dataset contents.
7. REPRO - copies records from one file to another.

27. What are the three levels of definition for the VSAM DEFINE?
DEFINE CLUSTER, DATA and INDEX

28. What is the significance of the SHARE OPTIONS parameter?
It specifies how the file may be shared between jobs and between batch and CICS environments.

29. How many Alternate Indexes you can have on a dataset?
255

30. What is the Difference between LDS & ESDS ?
ESDS maintains control information.
But LDS does not maintain the control information.

31. Is a delete operation possible in an ESDS?
No delete operation is not possible in VSAM ESDS

32. Is rewrite operation possible in ESDS ?
Yes rewrite operation is possible in an ESDS.

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

34. How many buffers are alloted 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.

35. How do you load a VSAM data set with records?
Using the REPRO command.

36. 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)

37. 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.

38. Suppose 3 generations of a GDG exist. How would you reference the 1st generation in the JCL?
Use GDG name(-2). It is relative naming format.

39. 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.

40. 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 Dataset Control Block parameter if you want to override the DCB of the model dataset.

41. Assuming that the DEFINE JCL is not available, how do you get info about a VSAM file's organization?
Use the LISTCAT command.

42. During processing of a VSAM file, some system error occurs and it's subsequently unusable. What do you do?
Run VERIFY.

43. How many times Secondary Space Allocated?
122 times

IDMS: 

1. What is the difference between a schema and a sub schema?

The schema is the physical arrangement of the data as it appears in the DBMS. The sub schema is the logical view of the data as it appears to the application program.

2. What is a page?
A page is the smallest unit of storage in an IDMS database.

3. What is a region?
Region is used synonymously with area. It is a group of logically contiguous pages.

4. Explain the difference between record occurrence and record type.
A record occurrence is the instances of a record; it is the smallest addressable unit of data. A type is the description of a record; there needn't be any occurrences.

5. What is the difference between local and central version operating modes?
In local there is no IDMS System running above the DBMS. It's the more efficient mode but lacks the recovery and integrity facilities of the central version (CV) control program. In CV many application programs access the database through a single copy of the DBMS.

6. What is a run unit?
A run-unit is a logical unit of work; it is analogous to a CICS task.

7. What is the purpose of a READY?
The READY prepares a database area for access by DML functions.

8. What does a COMMIT statement do?
It writes a checkpoint to the Journal File and releases any record locks.

9. What does a ROLLBACK do?
It rolls back (reverses) all database updates to the point of the last rollback or to the beginning of the run-unit.

10. What does a FINISH do?
It releases all database resources, terminates database processes, writes statistical information to IDMS and logs the checkpoint.

11. What is the meaning of the return codes 0307 and 0326?
0307  - end-of-set
0326 - record not found

12. What is the meaning of 'Copy IDMS Subschema-Binds'?
It generates a bind run-unit and binds all the records for the sub-schema the program is referencing.

13. How does IDMS insure data integrity?
IDMS uses record locks to prevent another run-unit from updating the same record.

14. What are the types of record locks and how are they set?

Locks may be shared or exclusive. Shared means that other run units can retrieve the record but can not modify it. Exclusive means that other run units can neither retrieve nor modify it. Record locks may be implicit or explicit. Implicit locks are set in the ready statement usage clause. Explicit locks are set using either the keep statement or keep option of the find/obtain command.

15. How are record locks released?
Locks are released by a change in currency or by a commit, rollback or finish command.

16. What is an OOK-Rec?
An OOK-Rec is one of a kind record, used to get another record set.

17. Name and explain the three location modes.
CALC is based on symbolic value, which is used to determine the target page. VIA modes is for members only. VIA records are stored near their owners. In DIRECT mode the target is specified by the user and is stored as close as possible to that page.

18. What is a bind?
A bind associates record type with the program work area; for run units and records, it is the first command issued in the program.



DB2:

1. What is DB2?

DB2 is a subsystem of the MVS Operating system. It is a Database Management System (DBMS) for that operating system.

2. What is an Access path?
Access path is the path used to get to the data specified in the SQL.

3. What is an object?
It is anything that is managed by DB2 (i.e., alias, column, stogroup, database, table-space, table, view, index, synonym), but not the data itself.

4. What is the DataBase Descriptor?
The database descriptor, DBD is the DB2 component that limits access to the database whenever objects are created, altered or dropped.

5. What is meant by the attachment facility?
The attachment facility is an interface between DB2 and TSO, IMS/VS, CICS, or batch address spaces. It allows application programs to access DB2.

6. What is meant by AUTO COMMIT?
AUTO COMMIT is a SPUFI option that commits the effects of SQL statements automatically if they are successfully executed.

7. What is a base table?
A base table is a real table - a table that physically exists in that there are physical stored records.

8. What is the function of buffer manager?
The buffer manager is the DB2 component responsible for physically transferring data between an external medium and (virtual) storage (performs the actual I/O operations). It minimizes the amount of physical I/O
actually performed with sophisticated buffering techniques(i.e., read-ahead buffering and look-aside buffering).

9. What is a buffer pool?
A buffer pool is main storage that is reserved to satisfy the buffering requirements for one or more table spaces or indexes, and is made up of either 4K or 32K pages.

10. How many buffer pools are there in DB2?
There are four buffer pools: BP0, BP1, BP2, BP32

11. On the create table space, what does the CLOSE parameter do?
CLOSE physically closes the table space when no one is working on the object. DB2 (release 2.3) will logically close table spaces.

12. What is a clustering index?
It is a type of index that
(1) locates table rows and
(2) determines how rows are grouped together in the table space.

13. What will the COMMIT accomplish?
COMMIT will allow data changes to be permanent. This then permits the data to be accessed by other units of work. When a COMMIT occurs, locks are freed so other applications can reference the just committed data.

14. What is cursor stability?
It is cursor stability that “tells” DB2 that database values read by this application are protected only while they are being used. (Changed values are protected until this application reaches the commit point). As soon as a program moves from one row to another, other programs may read or the first row.

15. What is concurrency and how is it controlled?
Concurrency is when more than one program can access the same data at the same time. You control concurrency by establishing locks so that no program can access uncommitted data that has been changed by another program.

16. What is meant by isolation level?
Isolation level describes the method used to lock and unlock DB2 space. It is one of the parameters you specify when you do a BIND.

17. Describe the different isolation levels in order of concurrency.
CS (Cursor stability) – DB2 keeps the lock on the row until the next row is fetched or the unit of work is committed.
RR (Repeatable Read) - DB2 keeps the lock on all the rows that an application references during the unit of work.
UR (Uncommitted Read) - has fastest data access. Can be used to access uncommitted data.
RS – Locks the rows that are part of the result set.

18. What are the different kinds of table locks available in DB2?

IN – Intent None. Owner of the lock can read any data in the table.
IS – Intent Share. Owner of the lock can read any data in the table, if the S lock can be obtained on the target rows.
S – Share. Owner of the lock can read any data in the table, but will not obtain any row locks.
IX – Intent eXclusive. Owner of the lock can read or change any data in the table, if the X lock is obtained on the rows to be changed, and U or S lock can be obtained on the rows to be read.
SIX – Share With. Owner of the lock can read any data in the table and intent eXclusive change rows if it can obtain an X lock on the target rows.
U – Update. Owner of the lock can read and change any data in the table, if an X lock on the table can be obtained.
X – eXclusive. Owner of the lock can read or change any data in the table. No row locks are obtained.
Z – Super exclusive. No other application can access the table.
S – Share. Row is being read by one application and is available for read only by concurrent applications.
\
19. What is the function of the Data Manager?
The Data Manager is a DB2 component that manages the physical databases. It invokes other system components, as necessary, to perform detailed functions such as locking, logging, and physical I/O operations (such as search, retrieval, update, and index maintenance).

20. What is a data page?
A data page is a unit of retrievable data, either 4K or 32K (depending on how the table is defined), containing user or catalog information.

21. What does DSNDB07 database do?
DSNDB07 is where DB2 does its sorting. It includes DB2’s sort work area and external storage.

22. What is a foreign key?
A foreign key is a column (or combination of columns) in a table whose values are required to match those of the primary key in some other table.

23. What is Referential Integrity or RI? How is it enforced?
Means that foreign keys from one table references the primary key in another.
The DBA (database administrator) uses referential constraints when creating tables using the FOREIGN KEY clause.
A referential constraint consists of 3 components:
1-a constraint name
2-columns comprising the FOREIGN KEY
3-REFERENCES clause

24. How can a insert of a new foreign key value threaten referential integrity?
The new foreign key value must reference or have a matching primary key value in the related table.

25. What is a Check Constraint? How is it enforced?
The DBA can implement these to place specific data value restrictions on certain columns using the CONSTRAINT clause.
They consists of 2 components:
1-a CONSTRAINT name
2-a check condition

26. What is the EXPLAIN statement? How many ways can this be done? Where does it get stored?
The EXPLAIN statement will show the access paths the DB2 optimizer uses to process the SQL statements in a program.

There are 2 ways to do an EXPLAIN:
1-interactively using EXPLAIN ALL SET QUERYNO=n FOR SQL statement... ;
or
2-as part of the BIND process using the parameter EXPLAIN(YES)
The results are stored in userid.PLAN_TABLE (which you should have already created with the pre-assigned columns).

27. What is an Index?
It is a set of row identifiers (RIDs) or pointers that are logically ordered based on the values of indexed columns. Indexes provide faster data access and can enforce uniqueness on the row in a table. An index key is a column or set of columns in a table used to determine the order of index entries.

28. What is an Index Scan?
When an entire index (or a portion thereof) is scanned to locate rows, we call this an index scan. This type of access can be used, for example, to select all rows of a table in some order and avoid a sort for a query.

29. What is a recovery log?
It is a collection of records that describes the sequence of events that occur in DB2. The information is needed for recovery in the event of a failure during execution.

30. What is meant by entity integrity?
It is when the primary key is in fact unique and not null.

31. What will the FREE command do to a plan?
It will drop (delete) that existing plan.

32. What will the GRANT command do?
It will grant privileges to a list of one or more users. If the GRANT is used in conjunction with PUBLIC, then all users will be granted privileges. It can also be done by objects and types.

33. What is an image copy?
It is an exact reproduction of all or part of a table-space. DB2 provides utility programs to make full-image copies (to copy the entire table-space) or incremental image copies (to copy only those pages that have been modified since the last image copy).

34. What does locking mean?
It is a process that is used to ensure data integrity. It also prevents concurrent users from accessing inconsistent data. The data (row) is locked until a commit is executed to release the updated data.

35. What is a "non-leaf" page?
This is a page that contains keys and page numbers of other pages in the index. Non-leaf pages never point to actual data.

36. Is there any advantage to denormalizing DB2 tables?
Denormalizing DB2 tables reduces the need for processing intensive relational joins and reduces the number of foreign keys.

37. What is lock contention?
To maintain the integrity of DB2 objects the DBD permits access to only on object at a time. Lock contention happens if several objects are required by contending application processes simultaneously.

38. What is SPUFI?
SPUFI stands for SQL processing using file input. It is the DB2 interactive menu-driven tool used by developers to create database objects.

39. What is an Alias?
It is an alternate name that can be used by everyone to refer to a table or view in the same or a remote DB2 subsystem.

40. What is the difference between an alias and a synonym?
They are basically the same except that a synonym can only be used by the creator and stored in the SYSIBM.SYSSYNONYMS catalog table.


1 comment:

  1. Very significant Information for us, I have thought the representation of this Information is an actually superb one. This is my first visit to your site. coaching institute in Mumbai

    ReplyDelete