When creating the ACCESS MODULE for a program with embedded SQL, the following error is displayed:
DB005202 T838 C1M324: Number of input and output columns are not the same
This normally happens when the number of host variables in a FETCH statement does not match with the number expected according to the related SELECT statement.
However, in this case it’s occurring on a single SET statement so that situation is not possible.
At least one of the host variables has subordinates. In CA-IDMS, embedded SQL can only work with host variables that are at the “bottom” of the element structure and have no subordinates.
For example, with this structure:-
01 P1 PIC X(80).
01 P2.
05 P2-A PIC X(40).
05 P2-B PIC X(40).
01 P3 PIC X(8).
The following statement will result in the DB005202 error when creating the ACCESS MODULE.
EXEC SQL
SET :P1 = REPLACE(:P2,’&CONTEXTID’,RTRIM(:P3))
END-EXEC.
Change the definition of the host variables to this:
01 P1 PIC X(80).
01 P2 PIC X(80).
01 P3 PIC X(8).
For further information, see the following CA IDMS DocOps section:-