DB21023E UNKNOWN HOST VARIABLE using COBOL COPY in DBXMMPR preprocessor
search cancel

DB21023E UNKNOWN HOST VARIABLE using COBOL COPY in DBXMMPR preprocessor

book

Article ID: 234899

calendar_today

Updated On:

Products

Datacom Datacom/DB

Issue/Introduction

The Datacom COBOL preprocessor DBXMMPR is not expanding copy books. Using COPY REPLACING COBOL syntax.

Program code defining host variables:

      EXEC SQL BEGIN DECLARE SECTION END-EXEC

      01  C-REC.
      COPY CREC REPLACING
      ==01  C-ORG== BY ==    05 C-ORG   PIC X(06)==.

      EXEC SQL END DECLARE SECTION END-EXEC

Error message:

DB21023E ---- UNKNOWN HOST VARIABLE: 'C-ORG'

 

Environment

Release : 15.1

Component : DATACOM SQL

Cause

DBXMMPR will not expand COBOL COPY statements so it can't be used to define SQL host variables.

Resolution

The SQL INCLUDE directive can be used in place of COPY to copy statements from the INCLUDE library. However it does not support the REPLACE option so the copybook has to be coded with the correct fields.

Replace the COPY with this code:


EXEC SQL
     INCLUDE CREC
END-EXEC.

Then add an INCLUDE DD statement to the DBXMMPR JCL pointing to the library that contains the copy book:

//INCLUDE  DD DSN=hlq.include.library,DISP=SHR