SQL/MP Programming Manual for COBOL85
Explicit Program Compilation
HP NonStop SQL/MP Programming Manual for COBOL85—429326-004
6-3
Requirements for Compiling a COBOL Program
For a detailed description of directives ignored by the NMCOBOL compiler, see the
COBOL85 for NonStop Systems Manual. The requirements for compiling a COBOL
program are discussed next.
Requirements for Compiling a COBOL Program
Feature or Option COBOL Compiler Requirements
SQL directive Required
SQLMEM directive Optional
SQLCODE identifier Required for each program and nested program. You must
declare an SQLCODE identifier either explicitly or implicitly using
the INCLUDE SQLCA directive.
old: Requires each program (and nested program) to declare an
SQLCODE identifier either explicitly or implicitly using the
INCLUDE SQLCA directive.
SQLCODE level-88
items
Optional. You can use level-88 items with an SQLCODE data item
by substituting an SQLCODEX data item. See Using the
SQLCODEX Data Item on page 9-5.
old: Allows SQLCODE and SQLCODEX data item declarations for
level-88 data items.
SQLCA data structure The compiler:
•
Declares an SQLCA structure in a program only if the source
file specifies an INCLUDE SQLCA directive.
•
Allows an INCLUDE SQLCA directive in the Extended-
Storage Section.
SQL statement
placement
Allows COBOL statements and embedded SQL statements to be
on the same line, except that a COBOL statement must follow the
SQL statement terminator, cannot precede an SQL statement,
and cannot be a COPY or REPLACE statement.
Library files Supports the COBOL SOURCE directive.
COPY and
REPLACE statements
The compiler implements these restrictions:
A COPY or REPLACE statement is not allowed within SQL
statements and cannot contain SQL statements. They affect SQL
statements only between BEGIN DECLARE and END DECLARE
directives.
•
A COPY statement cannot copy source text that contains
SQL statements.
•
A REPLACE statement that precedes one or more SQL
statements does not affect them, except in a Declare Section.
SQL cursors Supports local and foreign cursors.
SQL statements in
listing
Lists SQL statements in the compiler listing exactly as they appear
in the source program.