My Oracle Support Banner

RDBPROD: COBOL-E-ERROR 391 When Compiling a COBOL Program Using CDD/Repository and VARCHAR column (Doc ID 113685.1)

Last updated on AUGUST 07, 2018

Applies to:

Oracle Rdb Server on OpenVMS - Version 6.1 and later
Oracle CDD/Repository - Version 6.1 and later
HP OpenVMS VAX
HP OpenVMS Alpha
HP OpenVMS Itanium

Symptoms

When you compile a COBOL application that copies definitions from an Rdb database schema object in the CDD/Repository, the following warning may be returned:

  COBOL-W-ERROR 391, invalid or unsupported CDD datatype - treated as alphanumeric

or

  COBOL-W-BADDTYPE1, Invalid or unsupported CDD datatype - treated as alphanumeric

For example, you can reproduce this problem by defining a record in an Rdb database that contains a column with a varchar datatype.  Next, integrate the database into a CDD/Repository dictionary.  Then in a COBOL program, copy this record definition.

  SQL> ATTACH 'FILENAME mf_personnel';
  SQL> CREATE TABLE rec1 (col1 char(20), col2 varchar(200));
  SQL> COMMIT;
  SQL> DISCONNECT ALL;
  SQL> INTEGRATE DATABASE FILENAME mf_personnel
  cont> CREATE PATHNAME cdd_path:mfp;
  SQL> COMMIT;

For this example, use this very small program, test.sco:

  IDENTIFICATION DIVISION.
  PROGRAM-ID.  Test.
  ENVIRONMENT DIVISION.
  DATA DIVISION.

  WORKING-STORAGE SECTION.

  EXEC SQL DECLARE ALIAS FILENAME mf_personnel END-EXEC.
  EXEC SQL INCLUDE SQLCA END-EXEC.
  EXEC SQL INCLUDE FROM DICTIONARY
       'cdd$default:mfp.rdb$relations.rec1' END-EXEC.

  PROCEDURE DIVISION.
  001.
      DISPLAY "Testing started".

      EXEC SQL DECLARE rec1cur CURSOR FOR SELECT * FROM rec1 END-EXEC.

      EXEC SQL OPEN rec1cur END-EXEC.
      EXEC SQL FETCH rec1cur INTO rec1 END-EXEC.

      DISPLAY "col1: ", col1.
      DISPLAY "col2: ", col2.

      STOP RUN.

Now compile.  Note the resulting error:

  $ sco:==$SQL$PRE/COBOL
  $ sco test
    02  COL2                PIC X(202).
  ........^
  %COBOL-W-BADDTYPE1, Invalid or unsupported CDD datatype - treated as
     alphanumeric
  at line number 45 in file cdd$default:mfp.rdb$relations.rec1
  %COBOL-W-ENDDIAGS, DISK1:[USER1.RDB.TEST_EXAMPLES]REC1.COB;8
     completed with 1 diagnostic 

In current versions, the compile may not produce ANY error, however the listing will show the VARCHAR field has been incorrectly translated to CHAR(202).

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.