Say, I have a copybook 'CPBK' which is placed in MYFOLDER.
CPBK:
03 WA-FIELD1 PIC X.
03 WA-FIELD2 PIC S9(9) BINARY.
03 WA-FIELD3 PIC 9(3).
So when I access copybook in my program I use following statement
in Working Storage Section.
COPY CPBK in MYFOLDER.
Now, I have a table having following fields
TABL :
FIELD_1 CHAR (1),
FIELD_2 NUMBER (9),
FIELD_3 CHAR (3)
I want to perform 'Select * from TABL' and fetch the details in
copybook CPBK
But I get compilation error when trying to declare following:
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 CPBKREC.
COPY CPBK IN MYFOLDER.
EXEC SQL END DECLARE SECTION END-EXEC.
and for fetch - FETCH INTO : CPBKREC
Getting following compilation error-
INTO : CPBKREC
.................................1
PCB-S-00208, Incorrect type for host variable "CPBKREC"
Can anyone please help resolving this.