Will precompile of an DB2-COBOL program bomb, if DB2 is down?

No. Because the precompiler does not refer to the DB2 catalogue tables.

 How is a typical DB2 batch pgm executed ?

1. Use DSN utility to run a DB2 batch program from native TSO. An example is shown:

DSN SYSTEM(DSP3)

RUN PROGRAM(EDD470BD) PLAN(EDD470BD) LIB(‘ED 01T.OBJ.LOADLIB’)

END

2. Use IKJEFT01 utility program to run the above DSN command in a JCL.

Assuming that a site’s standard is that pgm name = plan name, what is the easiest way to find out which pgms are affected by change in a table’s structure ?

Query the catalogue tables SYSPLANDEP and SYSPACKDEP.

 Name some fields from SQLCA.

SQLCODE, SQLERRM, SQLERRD

 How can you quickly find out the # of rows updated after an update statement?

Check the value stored in SQLERRD(3).

 What is EXPLAIN? – drona questions

EXPLAIN is used to display the access path as determined by the optimizer for a SQL statement. It can be used in SPUFI (for single SQL statement ) or in BIND step (for embedded SQL ).

 What do you need to do before you do EXPLAIN?

Make sure that the PLAN_TABLE is created under the AUTHID.

 Where is the output of EXPLAIN stored? –

In userid.PLAN_TABLE

 EXPLAIN has output with MATCHCOLS = 0. What does it mean? –

a nonmatching index scan if ACCESSTYPE = I.

 How do you do the EXPLAIN of a dynamic SQL statement?

1. Use SPUFI or QMF to EXPLAIN the dynamic SQL statement

2. Include EXPLAIN command in the embedded dynamic SQL statements

Advertisements