Joined: 09 Oct 2006 Posts: 12 Location: Chennai, India
I'm not able to get the number of rows from a table using the following command.
This table has 8 columns. All are of the datatype - CHAR or DATE.
I have declared this variable in the working storage section.
When I created this variable type ALPHANUMERIC, the pgm compiles and runs successfully. But the above SQL statement returns SQLCODE = -303. This is because the datatypes are NOT comparable.
But, when I try to declare this variable as NUMERIC, I get the following message.
UNDEFINED OR UNUSABLE HOST VARIABLE "TOT-TABLE-RCD-CNT"
SELECT COUNT(*)INTO : TOT-TABLE-RCD-CNT FROM ABCD.TABLE1
Also, in the message I see a SPACE between ":" and the variable name(as seen above).