I have written a COBOL program containing embedded DB2 SQL. The SQL is given below,
EXEC SQL
SELECT COUNT(*) INTO :WS-COUNT FROM VM_DATA
END-EXEC.
Now while i am trying to execute the program it is showing error because of the record format of the variable of WS-COUNT. I have tried with the following options,
01 WS-COUNT pic x(18)
- If I use this one then it will show error during the run time saying that record format is not same.
01 WS-COUNT pic 9(18) COMP
- If I use this one then it will show error during the compile time saying that undefinied type for WS-COUNT
01 WS-COUNT pic 9(18) COMP-3
-If I use this one then it will show error during the compile time saying that undefinied type for WS-COUNT
So I need your help to solve this problem. Can anybody please tell me what should be the format for the variable WS-COUNT?
Joined: 14 Sep 2005 Posts: 50 Location: Kentucky, USA
hi joney
ignore my previous mail. for the sql to rin you cab define the host variable as PIC S9(09) COMP. Think this should also work. If not then you can use my previous reply