View previous topic :: View next topic
|
Author |
Message |
kranthikumarb
Active User
Joined: 02 Jan 2009 Posts: 115 Location: Hyderabad
|
|
|
|
Hi,
I have a table in which a field "accno" is defined as numeric(5). Wen i genereated the DCLGEN for the table, the same field is decimal(5,0) and the corresponding hoset variable is "ws-accno" with data type s9(5)v usage comp-3.
Now when i try to use a query in tha program, it is throwing an error.
The query is
Select MAX(accno) into :ws-accno from account
The error is undefined or unusable host variable ws-accno.
1) I tried using a local variable
2) i tried using a comp variable instead of comp-3
3) i changed the query to write max function in a sub query.
Nothing worked out.
Please help me |
|
Back to top |
|
|
Suresh Ponnusamy
Active User
Joined: 22 Feb 2008 Posts: 107 Location: New York
|
|
|
|
Hi
1) What is the definition of ws-accno in your program.
2) Are you directly using this variable in the query or doing some operation (initialize or move) before that. |
|
Back to top |
|
|
muthukannan
New User
Joined: 03 Aug 2006 Posts: 42 Location: Chennai
|
|
|
|
Hi,
Have you included the DCLGEN in your COBOL program. |
|
Back to top |
|
|
CHANDAN KAPOOR
New User
Joined: 12 Apr 2008 Posts: 36 Location: NOIDA
|
|
|
|
I think you shull use null indicator variable also if the column is nullable in the database. |
|
Back to top |
|
|
Bharath Bhat
Active User
Joined: 20 Mar 2008 Posts: 283 Location: chennai
|
|
|
|
There are a lot of functions which are nullable even though the columns are not nullable. This is one of them. But I do not think it would say unusable host variable. We'll get this if the variable is not declared or : is missing from the query. Check this in your program. If it is not the problem, paste the code from your program(both declaration and the SQL). |
|
Back to top |
|
|
sumit agarwalla
New User
Joined: 13 Nov 2008 Posts: 17 Location: hyderabad
|
|
|
|
Quote: |
The error is undefined or unusable host variable ws-accno |
Check if u have included the DCLGEN member in Area B.This error is sometimes thrown when the DCLGEN member is not in Area B and thus the variable is not recognised by the application program |
|
Back to top |
|
|
|