SQL/MP Programming Manual for COBOL

Explicit Program Compilation
HP NonStop SQL/MP Programming Manual for COBOL529758-003
6-10
Setting DEFINEs
22> ADD DEFINE =collate1, CLASS MAP, FILE collate1
...
If you specify a DEFINE name in an SQL statement that is not in your current set
of DEFINEs, the SQL compiler issues a warning message and leaves the
statement uncompiled in the object file. When you run your program, the SQL
executor automatically tries to recompile the SQL statement. If the DEFINE is still
not available at run time, the SQL compiler issues an error message.
When you run the SQL compiler, you can specify a CLASS SPOOL DEFINE for
the OUT file and a class CATALOG DEFINE for the catalog option. If you use these
DEFINEs, add them before you enter the SQLCOMP command:
30> ADD DEFINE =persnl, CLASS CATALOG, SUBVOL persnl
31> ADD DEFINE =sqlist, CLASS SPOOL, LOC $S.#sqlist
32> SQLCOMP /IN sqlcbprg,OUT =sqlist,NOWAIT/ CATALOG =persnl
To use the DEFINEs stored in the program file when you explicitly recompile a
program, specify the STOREDDEFINES option of the SQLCOMP command. For a
description of the STOREDDEFINES option, see SQL Compiler Options on
page 6-28.
Using DEFINEs in the OSS Environment
Use these OSS utilities to create and manipulate class MAP and class CATALOG
TACL DEFINEs in the OSS environment:
Although you run these utilities in the OSS environment, each utility uses Guardian
conventions for its DEFINE attribute and the associated values. For a detailed
description, including the syntax of these utilities, see the Open System Services Shell
and Utilities Reference Manual.
Considerations for using TACL DEFINEs in the OSS environment are:
The add_define utility implicitly sets the DEFMODE attribute to ON before it
creates the new DEFINE.
Before you run the compiler using the cobol or nmcobol utility, add these
DEFINEs:
Note. For information on adding DEFINEs in the OSS environment, see Using DEFINEs
in the OSS Environment on page 6-10.
add_define Creates a new class MAP, CATALOG, SPOOL, SORT,
SUBSORT, SEARCH, or TAPE DEFINE
del_define Deletes one or more DEFINEs
info_define Displays the attributes and values of existing DEFINEs
set_define Sets the values for one or more DEFINE attributes in the
current working attribute set
show_define Displays the values for one or more DEFINE attributes in the
current working attribute set