SQL/MP Programming Manual for COBOL

Explicit Program Compilation
HP NonStop SQL/MP Programming Manual for COBOL529758-003
6-42
Using the EXPLAIN Utility
current default catalog. The SQL compiler uses the current set of DEFINEs and writes
the output to the spooler location $S.#EXPLAIN:
SQLCOMP / IN SQLPROG, OUT $S.#EXPLAIN /
CATALOG $DISK2.SALES, EXPLAIN PLAN
EXPLAIN DEFINES Report
The EXPLAIN DEFINES report shows the mapping of DEFINE names used in SQL
statements with this information:
The default volume and catalog used by the program (obtained from the
=_DEFAULTS DEFINE)
Each DEFINE name and its associated Guardian name
The EXPLAIN utility can generate EXPLAIN DEFINES reports in either of these
formats:
This example shows an OBEY command file format report. In an actual report, each
instance of subvolume-name, guardian-name, and define-name would be
replaced by the actual name.
ALTER DEFINE =_DEFAULTS, VOLUME subvolume-name
ALTER DEFINE =_DEFAULTS, CATALOG subvolume-name
ADD DEFINE define-name, FILE guardian-name
ADD DEFINE define-name, FILE guardian-name
...
When you issue an OBEY command to execute the file shown previously, ensure that
the DEFINE mode (DEFMODE) is ON, and the DEFINE CLASS is MAP.
The INFO DEFINE format uses the same format as the INFO DEFINE command. This
example shows an INFO DEFINE format report. In an actual report, each
guardian-name and define-name would be replaced by the actual name.
DEFINE NAME =_DEFAULTS
CLASS DEFAULTS
VOLUME guardian-name
CATALOG guardian-name
DEFINE NAME define-name
CLASS MAP
FILE guardian-name
DEFINE NAME define-name
CLASS MAP
OBEY command file
format
EXPLAIN generates the ADD DEFINE commands that add
DEFINEs. You can then use a TACL OBEY command to
execute these commands.
INFO DEFINE format EXPLAIN generates a report in the format used by the
TACL INFO DEFINE command.