COBOL - DCLGEN Host Variable Are Ambiguous

Viewed 353

Hi I am trying to run a SQL select query with inner join on tbl1 & tbl2

the DCLGEN of 2 table i.e. DCLTBL1 & DCLTBL2 have few similar column name, due to this I am getting Error message as HOST variables Unresolved as the HOST variables are Ambiguous during compilation.

sql query:

EXEC SQL
 SELECT A.COLUMN1, A.COLUMN2 
   FROM TBL1 A INNER JOIN TBL2 B ON A.COLUMN1 = B.COLUMN2
  WHERE A.COLUMN1 = :HOST-VARIABLE1
    AND A.COLUMN2 = :HOST-VARIABLE2
END-EXEC.

what could be done to resolve this issue?

1 Answers

I Db2 on IBM Z allows for qualifying your host variables.

Try :HOST-VARIABLE1.:TBL1-DCLGEN-STRUCTURE

I might have that backwards.

Related