Created On:  11/21/2010

Problem:

There is a problem migrating OSVS COBOL using DB2 to Enterprise Server using Microsoft SQL Server 2008.

SQLCA.cpy compiler errors when used  with older mainframe dialect like OSVS and VSC24

Visual Studio 2008 compiler error messages
Quote found with APOST directive (future occurrences not flagged)
Unknown data description qualifier COMP-5
SQLCA is badly defined. This error prevents SQL processing from continuing – future EXEC SQL statements will be ignored.

Net express compiler error messages
COBCH0610S Quote found with APOST directive (future occurrences not flagged)
COBCH0233S Unknown data description qualifier COMP-5
COBES0002S SQLCA is badly defined. This error prevents SQL processing from continuing – future EXEC SQL statements will be ignored.

Resolution:

Compiling with older mainframe dialect the default SQLCA.CPY copybook that contains COMP-5 fields will give compiler errors.
For these older mainframe dialects you will need to use a SQLCA.CPY copybook that is compatible with the older mainframe dialects like the one below.

       01 SQLCA.
           05  SQLCAID         PIC X(8)         VALUE 'SQLCA   '.
           05  SQLCABC         PIC S9(9) COMP VALUE 136.
           05  SQLCODE         PIC S9(9) COMP VALUE 0.
           05  SQLERRM.
               49  SQLERRML    PIC S9(4) COMP.
               49  SQLERRMC    PIC X(70).
           05  SQLERRP         PIC X(8).
           05  SQLERRD         PIC S9(9) COMP OCCURS 6.
           05  SQLWARN.
               10  SQLWARN0    PIC X.
               10  SQLWARN1    PIC X.
               10  SQLWARN2    PIC X.
               10  SQLWARN3    PIC X.
               10  SQLWARN4    PIC X.
               10  SQLWARN5    PIC X.
               10  SQLWARN6    PIC X.
               10  SQLWARN7    PIC X.
               10  SQLWARN8    PIC X.
               10  SQLWARN9    PIC X.
               10  SQLWARN10   PIC X.
               10  SQLWARNA    REDEFINES SQLWARN10 PIC X .
           05  SQLSTATE    PIC X(5).
Incident #2475403