Skip Headers

Pro*COBOL® Programmer's Guide
Release 9.2

Part Number A96109-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

A 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:

A.1 New Features of Release 9.0.1

The new features and terminology in release 9.0.1 include:

A.1.1 Globalization Support

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

A.1.2 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".

A.2 New Features of Release 8.1

This section describes features which were new to release 8.1.

A.2.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".

A.2.2 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)".

A.2.3 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".

A.2.4 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.

A.2.5 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.

A.2.6 PREFETCH Option

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

A.2.7 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".

A.2.8 Universal ROWIDs

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

A.2.9 SYSDBA/SYSOPER Privileges in CONNECT Statements

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

A.2.10 Tables of Group Items

Tables of group items are now allowed as host variables in Pro*COBOL. See "Mimicking the CURRENT OF Clause".

A.2.11 WHENEVER DO CALL Branch

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

A.2.12 DECIMAL-POINT IS COMMA

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".

A.2.13 Optional Division Headers

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

A.2.14 NESTED Option

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

A.3 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.

A.3.1 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".

A.3.2 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:

  • Over-Punch (ZONED-DECIMAL). This is the default signed numeric for the COBOL language. Digits are held in ASCII or EBCDIC format in radix 10, with one digit for each byte of computer storage. The sign is held in the high order nibble of one of the bytes. It is called over-punch because the sign is punched-over the digit in either the first or last byte. The default sign position will be over the trailing byte. PIC S9(n)V9(m) TRAILING or PIC S9(n)V9(m) LEADING is used to specify the over-punch.

  • Display-1 Multibyte type (PIC G). This datatype is equivalent to PIC N and is used for multibyte characters.

See "Host Variables".

A.3.3 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".

A.3.4 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".

A.3.5 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".

A.3.6 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".

A.3.7 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".

A.3.8 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:

CALL "DSNTIAR" USING SQLCA MESSAGE LRECL.

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".

A.3.9 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 ISO yyyy-mm-dd
USA standard USA mm/dd/yyyy
European standard EUR dd.mm.yyyy
Japanese Industrial Standard JIS yyyy-mm-dd
installation-defined LOCAL Any installation-defined form.

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

A.3.10 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".

A.4 Other New Features of Release 8.0

This section describes features which were new for release 8.0.

A.4.1 New Name for Configuration File

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

A.4.2 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".

A.4.3 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".

A.4.4 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".

A.4.5 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".

A.4.6 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".

A.4.7 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.

A.4.8 Changing Password When Connecting

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

EXEC SQL CONNECT ... [ALTER AUTHORIZATION :new_password] END-EXEC.

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

A.4.9 Error Message Codes

Error and warning codes are different between earlier releases of Pro*COBOL and the current release. See Oracle 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.

A.5 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: Oracle Database Upgrade Guide for additional details.