Compaq COBOL
User Manual


Previous Contents Index

B.4.10 Calling Shareable Images

On OpenVMS, Compaq COBOL and Compaq COBOL for OpenVMS VAX exhibit different behavior when calling a subprogram installed as a shareable image. With Compaq COBOL, the program name you specify in a CALL statement can be either a literal or a data-name. (The same is true for the CANCEL statement.) With Compaq COBOL for OpenVMS VAX, the program name you specify in a CALL (or CANCEL) statement must be a literal. In addition, Compaq COBOL for OpenVMS VAX programs installed as shareable images cannot contain external files. (See Chapter 1 and OpenVMS Linker Utility Manual for more information about shareable images.) <>

On Windows NT and Tru64 UNIX systems, Compaq COBOL exhibits behavior more like Compaq COBOL for OpenVMS VAX with regard to shared objects. (Shared objects are the Windows NT and Tru64 UNIX equivalent to OpenVMS shared images.) For more information, see Chapter 12, Interprogram Communication. <>

B.4.11 Sharing Common Blocks (OpenVMS)

On OpenVMS, to prevent problems when you link a Compaq COBOL program and want to share a common block between processes, you should set the PSECT attribute to SHR (the defaults are: SHR on OpenVMS Alpha systems, NOSHR on OpenVMS VAX systems). Also, you should add a SYMBOL_VECTOR to the linker options file of the shareable image, as follows:


SYMBOL_VECTOR = (psect-name = PSECT) 

For more information, see the OpenVMS Linker Utility Manual. <>

B.4.12 Arithmetic Operations

Several arithmetic operations differ in behavior between Compaq COBOL and Compaq COBOL for OpenVMS VAX, depending upon your platform:

B.5 Compaq COBOL Differences Across Operating Systems

Certain Compaq COBOL features have unique behaviors, depending upon which of these operating systems you are using, and sometimes these differences differ from release to release. You should refer to the Release Notes to get the most recent information about these differences. The next few sections describe distinct differences in feature implementation and behavior.

B.5.1 REWRITE

A REWRITE operation for an ISAM file is dependent on whether the DUPLICATES clause for the primary key is specified. There is an ambiguity when DUPLICATES is specified in one way at the time a file is created, and another way when it is reopened (a program should use the same declarations). Both Compaq COBOL for OpenVMS VAX and Compaq COBOL for OpenVMS Alpha use the specification of the current program. So, if DUPLICATES was specified for the primary key when a file was created, but not when reopened by the current program, the behavior will be as if DUPLICATES were not allowed.

Compaq COBOL on Windows NT and on Tru64 UNIX issues a severe run-time error if there is a mismatch, unless relax key checking (the -rkc flag) is specified, in which case the behavior is inconsistent. In many cases, you will get the behavior of the specification when the file was created, but you should not rely on this.

B.5.2 File Sharing and Record Locking

With Compaq COBOL on Windows NT and on Tru64 UNIX, certain file-sharing and record-locking operations may behave differently from the same operations on Compaq COBOL on OpenVMS Alpha. Compaq COBOL on Windows NT and Tru64 UNIX issues warning diagnostics where applicable.

B.5.3 VFC File Format

If a VFC file is created on OpenVMS Alpha and then read on Windows NT or Tru64 UNIX, the data record will be returned with the 2-byte control string in the data record when it is read.

The workaround is to convert the file to a non-VFC format on OpenVMS Alpha. VFC files are created on OpenVMS Alpha by Compaq COBOL for OpenVMS VAX and Compaq COBOL for the following:

LINAGE
REPORT WRITER
SEQUENTIAL EXTERNAL/GLOBAL
Output with WRITE ADVANCING

B.5.4 File Attribute Checking

Compaq COBOL on Tru64 UNIX and Windows NT systems provides limited file attribute checking. No file attribute checking is performed for sequential and relative files. For indexed files, Compaq COBOL verifies that the following file attributes match what is specified in the application:

If these attributes are not matching, the file will not be opened and a fatal runtime error will occur (or Declaratives will be invoked, if applicable).

However, with the relax key checking option selected Compaq COBOL will allow you to open a file which specifies fewer keys than were specified when the file was originally created. This option will provide correct results only in those cases where the unspecified keys are USAGE DISPLAY (PIC X). Also, -rkc allows you to open a file which specifies DUPLICATES for a key in a way differently from the specification given when the file was created.

There is an additional check in creating an indexed file: unless relax key checking is specified, you may not have two keys that are identical except for whether DUPLICATES are allowed. If this restriction is violated, there will be an explicit run-time error message and those operations that are affected by DUPLICATES may give unexpected results.

B.5.5 Indexed Files

Compaq COBOL on Tru64 UNIX and Windows NT treats indexed files differently from the way they are treated by both Compaq COBOL on OpenVMS Alpha and Compaq COBOL for OpenVMS VAX on OpenVMS Alpha. Specifically:

B.5.6 RMS Special Register References in Your Code

Compaq COBOL on Windows NT and Tru64 UNIX does not support RMS Special Registers. If you include them, you may receive the following general diagnostic message when you attempt to compile the program:


cobol: Severe: ...Undefined name 

B.5.7 Time and Fractional Seconds

Fractions of seconds are not handled by the Compaq COBOL runtime library on Windows NT. The value zero is returned for those parts which cannot be determined. This impacts the following:

ACCEPT FROM TIME
FUNCTION CURRENT-DATE
FUNCTION WHEN-COMPILED <>

B.6 File Compatibility Across Languages and Platforms

Files created by different programming languages may require special processing because of language and character set incompatibilities. The most common incompatibilities are data types and data record formats. You should be aware of the following:

Data Type Differences

Data types vary by programming language and by utilities. For example, Compaq Fortran does not support the packed-decimal data type and, therefore, cannot easily use PACKED-DECIMAL data in COBOL files.

You can use the following techniques to overcome data type incompatibilities:

In the following example, the input file is written in EBCDIC. This creates a file that would be difficult to handle in most languages other than COBOL on the OpenVMS Alpha operating system.


ENVIRONMENT DIVISION. 
CONFIGURATION SECTION. 
SPECIAL-NAMES.   ALPHABET FOREIGN-CODE IS EBCDIC. 
INPUT-OUTPUT SECTION. 
FILE-CONTROL. 
     SELECT INPUT-FILE ASSIGN TO "INPFIL" 
            CODE-SET IS FOREIGN-CODE. 
            . 
            . 
            . 

B.7 LIB$INITIALIZE Interaction Between C and COBOL

If you use LIB$INITIALIZE when the main program is written in Compaq COBOL and the initialize routine is written in Compaq C, the initialize routine will not be called. If you are using Compaq COBOL for OpenVMS VAX on OpenVMS VAX Version 7.1, however, the routine will be called; also, it will be called if your main program is in C or in BASIC rather than COBOL, so this can be a practical workaround.

The problem is due to the quadword alignment with which C creates the LIB$INITIALIZE psect. The LIB$INITIALIZE psect requires longword alignment. The programmer can explicitly specify longword alignment on the extern_model pragma to avoid the problem.

B.8 Reserved Words

Depending on the use of the /RESERVED_WORDS qualifier or flag, there are a number of additional reserved words in Compaq COBOL that are not reserved in Compaq COBOL for OpenVMS VAX. See the appendix on reserved words in the Compaq COBOL Reference Manual for complete information.

B.9 Debugger Support Differences

Compaq COBOL debugger support differs in several ways from Compaq COBOL for OpenVMS VAX:

B.10 DECset/LSE Support Differences

Compaq COBOL does not support the DECset/LSE Program Design Facility, the /DESIGN qualifier, design comments, or pseudocode placeholders.

B.11 DBMS Support

On OpenVMS, Compaq COBOL support for Oracle DBMS has some differences depending on your platform (specifically, whether you are developing programs with Compaq COBOL on OpenVMS Alpha or with Compaq COBOL for OpenVMS VAX). <>

B.11.1 Compiling on Tru64 UNIX and Windows NT

In Compaq COBOL for Windows NT or Tru64 UNIX, Oracle DBMS sub-schema access (DML for Oracle DBMS) is not supported. Attempting to compile a program containing any Oracle DBMS syntax results in the following diagnostic message:


cobol: Severe: ...DBMS Data Manipulation Language is not supported 

Oracle DBMS syntax includes the following language elements: SUB-SCHEMA, DB, DB-EXCEPTION, LD, COMMIT, CONNECT, ERASE, FETCH, FIND, FREE, GET, KEEP, MODIFY, READY, RECONNECT, ROLLBACK, STORE, RETAINING, WHERE, EMPTY, MEMBER, OWNER, and TENANT.

You may also receive the following general diagnostic message when you attempt to compile a program (on Tru64 UNIX) that contains variables defined in your Oracle DBMS sub-schema:


cobol: Severe: ...Undefined name 

B.11.2 Multistream DBMS DML

With Compaq COBOL, when you use multistream Oracle DBMS DML, you must access different schemas or streams from separate source files.


Previous Next Contents Index