Installed the latest drop s1707130100) for DB2 V11.1 Mod 3 Fixpack 3which indicated it had support for multirowInsert/Fetch support in embedded COBOL applications but when I try to precompile program using IBM PRECOMPILER, I get error indicating no declared properly.
16 SQL0314N The host variable "w2-deptno" is incorrectly declared. 17 SQL0314N The host variable "w2-deptname" is incorrectly declared. 18 SQL0314N The host variable "w2-mgrno" is incorrectly declared. 19 SQL0314N The host variable "w2-admrdept" is incorrectly declared.
Definitions look like this:
05 w2-deptno pic x(6) occurs 10 times.
05 w2-deptname pic x(20) occurs 10 times.
05 w2-mgrno pic x(5) occurs 10 times.
05 w2-admrdept pic x(6) occurs 10 times.
So when it gets to multiple row INSERT statement, precompiler indicates error:
*exec sql insert into DEPT
*SQL4002N "W2-MGRNO" and "W2-DEPTNAME" are undeclared host
*variables that cannot both be used as descriptor names in a
*single SQL statement.
for :ws-no-rows rows
not atomic continue on sqlexception
Sample code is based on IBM DB2 z/os example program
We are in process of delivering the changes to DB2 v11.1 Mod 3 FP3. Changes are not yet delivered, will let you know the build level once we deliver.