Skip Headers

Pro*COBOL Precompiler Programmer's Guide
Release 9.2

Part Number A96109-01
Go To Documentation Library
Go To Product List
Book List
Go To Table Of Contents
Go To Index

Master Index


Go to previous page Go to next page

New Features

This appendix looks at the improvements and new features offered by the Oracle Pro*COBOL Precompiler. Each description includes a reference to more complete descriptions in the chapters is provided.

These topics are presented:

New Features of Release 9.0.1

The new features and terminology in release 9.0.1 include:

Globalization Support

National Language Support (NLS) was re-named Globalization Support.

New Datetime Datatypes

Pro*COBOL supports five new datetime datatypes: INTERVAL DAY TO SECOND, INTERVAL YEAR TO MONTH, TIMESTAMP, TIMESTAMP WITH TIMEZONE, and TIMESTAMP WITH LOCAL TIMEZONE. You can select from columns of these datatypes onto the OCIInterval and OCIDateTime host variables and into objects where attributes are datetime types. For details, see "Datetime and Interval Datatype Descriptors".

New Features of Release 8.1

Multithreading Applications Supported

Multithreaded COBOL applications are supported. A multithreaded Pro* C/C++ program can call a Pro*COBOL subprogram. See Chapter 12, "Multithreaded Applications".

CALL Statement

The CALL embedded SQL statement invokes a stored procedure. It can be used instead of an embedded PL/SQL block or a stored Java procedure in new applications. See "CALL (Executable Embedded SQL)".

Calling Java Methods

Stored procedures (methods) written in Java can be called from your application. For information on how to call a procedure written in Java, see "Stored PL/SQL and Java Subprograms".

LOB Support

An embedded SQL statement interface enables LOBs (large objects) to be used in precompiler applications. How LOBs are used, the internal and external LOBs, and comparisons with other ways to handle LOBs are presented. A presentation of each new SQL statement is made. Sample code shows how to use the LOB interface. See the chapter Chapter 13, "Large Objects (LOBs)" for complete details.

ANSI Dynamic SQL

The complete ANSI implementation of dynamic SQL Method 4 through embedded SQL statements is presented in Chapter 10, "ANSI Dynamic SQL". An overview with simple examples is presented. This is followed by a complete discussion of the new SQL statements. Sample programs from the demo directory are then shown.


This precompiler option speeds up database access by prefetching values, thus cutting down the number of network round-trips. See "The PREFETCH Precompiler Option".

DML Returning Clause

This clause, which enables you to save round-trips to the database server, is now allowed in INSERT, DELETE, and UPDATE statements. See "Inserting Rows".

Universal ROWIDs

The support for universal ROWID datatype is presented. Index-organized tables use this concept. See Universal ROWIDs.

SYSDBA/SYSOPER Privileges in CONNECT Statements

To set these privileges using the CONNECT statement, see "Connecting to Oracle".

Tables of Group Items

Tables of group items are now allowed as host variables in Pro*COBOL. See "Tables of Group Items as Host Variables".


The WHENEVER directive now has a DO CALL action: a subprogram is called. See "WHENEVER Directive".


The DECIMAL-POINT IS COMMA clause is supported. This permits commas to be used instead of decimal points in numeric literals. See "Decimal-Point is Comma".

Optional Division Headers

The following divisions and their contents are now optional: IDENTIFICATION, ENVIRONMENT, DATA. See "Division Headers that are Optional".


When set to NO, the NESTED precompiler option will prevent generation of the GLOBAL clause for non-nested programs. See "NESTED".

DB2 Compatibility Features of Release 8.0

These new features in Pro*COBOL release 8.0 help you migrate applications from DB2 to Oracle, but all users of Pro*COBOL should review them.

Optional Declare Section

Use of the BEGIN DECLARE SECTION and END DECLARE SECTION statements is now optional when DECLARE_SECTION=NO (the default). If used, the DECLARE statements must be properly paired within the same WORKING-STORAGE SECTION or other COBOL declaration unit. For more details, see "DECLARE_SECTION".

Support of Additional Datatypes

The computational usage datatype COMP-4 (COMPUTATIONAL-4) is treated as a binary datatype. The IBM-implemented computational data type, COMP-4 (also represented as COMPUTATIONAL-4,) will be treated as a binary datatype.

Display usage datatypes now supported are:

See "Host Variables"

Support of Group Items as Host Variables

Pro*COBOL now enables the use of group items in embedded SQL statements. The host group items can be referenced in the INTO clause of a SELECT or a FETCH statement, and in the VALUES list of an INSERT statement. When a group item is used as a host variable, only the group name is used in the SQL statement. For more details see "Group Items as Host Variables".

Implicit Form of VARCHAR Group Items

The declaration of COBOL groups that are recognized as VARCHAR are of the following format:

 nn   <identifier-1>
      49   <identifier-2> PIC S9(4) <integer declaration>.
      49   <identifier-3> PIC X(nc).

where the level, nn, is in the range 01 to 48, the length, nc, is in the range 1 to 65533.

The VARCHAR=YES command line option must be specified for Pro*COBOL to recognize the extended form of the VARCHAR group items. Otherwise, any declarations in the above format will be interpreted as regular group items. For more details, see "Referencing VARCHAR Variables".

Explicit Control Over the END-OF-FETCH SQLCODE Returned

DB2 returns a SQLCODE value of 100 when an end-of-fetch condition occurs. To provide explicit control over the value returned by Oracle, the following option is available:

END_OF_FETCH={100 | 1403 (default)}

This precompiler option must be used on the command line or in a configuration file. For more details see "END_OF_FETCH".

Support of the WITH HOLD Clause in the DECLARE CURSOR Statement

DB2 closes all cursors on commit, by default. This can be overridden on a cursor (which has been declared as FOR UPDATE) by using the WITH HOLD clause in the declaration of the cursor. Any cursor with the WITH HOLD clause will remain open after a commit or a rollback. The DB2 default occurs when MODE=ANSI, but then all host variables must be declared in a declare section. See "Declaring a Cursor".

New Precompiler Option CLOSE_ON_COMMIT

A new precompiler option is provided:

CLOSE_ON_COMMIT={YES | NO (default)}

This option must be used on the command line or in a configuration file. It will only have an effect when a cursor is not coded using the WITH HOLD clause, since that will override both the CLOSE_ON_COMMIT setting and the existing behavior which is associated with MODE option. For more details, see "Declaring a Cursor" and "CLOSE_ON_COMMIT".

Support for DSNTIAR

DB2 provides a routine DSNTIAR to obtain a form of the SQLCA that can be displayed. Pro*COBOL now provides DSNTIAR. The interface is:


where SQLCA is a SQL communication area, MESSAGE is the output message area, in VARCHAR form of size greater than or equal to 240, and LRECL is a full-word containing the length of the output messages, between 72 and 240. For more details, see "DSNTIAR".

Date String Format Precompiler Option

For compatibility with DB2, Pro*COBOL now provides the following precompiler option to specify date strings:

DATE_FORMAT={ISO | USA | EUR | JIS | LOCAL | 'fmt' (default LOCAL)}

The DATE_FORMAT option must be used on the command line or in a configuration file. The date strings are shown in the following table:

Table A-1 Formats for Date Strings
Format Name Abbreviation Date Format

International Standards Organization



USA standard



European standard


Japanese Industrial Standard





Any installation-defined form.

'fmt' is a date format model, such as "mm, dd, yyyy". See the Oracle9i SQL Reference for the list of date format model elements. For more details, see "DATE_FORMAT".

Any Terminator Allowed After SQL Statements

A SQL statement now can be terminated by a comma, a period or another COBOL statement. For more details, see "Sentence Terminator".

Other New Features of Release 8.0

New Name for Configuration File

The configuration file is now called pcbcfg.cfg, instead of pccob.cfg. See "Entering Precompiler Options".

Support of Other Additional Datatypes

The computational usage datatype PACKED-DECIMAL is treated as COMP-3 datatype for ANSI compatibility.

The datatype SCALED DISPLAY (PIC 9(n) and PIC S9(n)) is supported. Digits are held in ASCII or EBCDIC format in radix 10, with one digit for each byte of computer storage. If present, the sign is held in a separate byte (designated by the phrase SIGN SEPARATE). The position is trailing, the default, or may be specified using the SIGN TRAILING clause.

See "Host Variables".

Support of Nested Programs

Pro*COBOL now enables nested programs with embedded SQL within a single source file. Nested programs cannot be recursive. All level 01 items which are marked as global in a containing program and are valid host variables at the containing program level are usable as valid host variables in any programs directly or indirectly contained by the containing program. For more details, see "Nested Programs".

Support for REDEFINES and FILLER

The REDEFINES clause can be used to redefine group items. For more details, see "REDEFINES Clause".

The word FILLER is now allowed in host variable declarations. For more details, see "Host Variables".

New Precompiler Option PICX

The default datatype for PIC X variables is changed from VARCHAR2 to CHARF. A new precompiler option provides backwards compatibility:

PICX={VARCHAR2 | CHARF (default)}

This option is allowed only on the command line or in a configuration file. The new default behavior is consistent with the normal COBOL move behavior.

For more details, see "PICX".

Optional CONVBUFSZ Clause in VAR Statement

This clause specifies an optional buffer used for conversion between character sets.

For more details, see "CONVBUFSZ Clause in VAR Statement".

Improved Error Reporting

Errors are now associated with the proper line in any list file or in any terminal output. "Invalid host variable" errors state why the given COBOL variable is invalid for use in embedded SQL.

Changing Password When Connecting

The executable embedded SQL statement CONNECT has a new optional, final clause which enables you to change the password:


See "Changing Passwords at Runtime" and "CONNECT (Executable Embedded SQL Extension)" .

Error Message Codes

Error and warning codes are different between earlier releases of Pro*COBOL and the current release. See Oracle9i Database Error Messages for a complete list of codes and messages.

The runtime messages issued by SQLLIB now have the prefix SQL-, rather than the RTL- prefix used in earlier Pro*COBOL releases. The message codes remain the same as those of earlier releases.

When precompiling with SQLCHECK=SEMANTICS, PLS is the prefix used by the PL/SQL compiler. Such errors are not from Pro*COBOL.

Migration From Earlier Releases

Existing applications written in Pro*COBOL will work unchanged with an Oracle9i server. If you precompile again, you may have to change the settings of the precompiler options. See Chapter 14, "Precompiler Options".

See Also: Oracle9i Database Migration for additional details.

Go to previous page Go to next page
Copyright © 1996, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Go To Product List
Book List
Go To Table Of Contents
Go To Index

Master Index