View previous topic :: View next topic
|
Author |
Message |
Kamlesh Kamal
New User
Joined: 16 May 2008 Posts: 36 Location: Kolkata,India
|
|
|
|
Hi,
I have a cobol db2 program which has the following db2 query embedded in it.
Code: |
EXEC SQL
SELECT ENTY_ID
INTO :WS-ENTY-ID
FROM TEPPROD
WHERE RTRIM(LTRIM(PROD_ID)) = :ROAS-MASTER-KEY
AND SRC_FRNCHS_VAL = 'MLFS'
END-EXEC
|
The corresponding declaration of the host variables are as under (in working storage)
Code: |
05 WS-ENTY-ID PIC 9(09) VALUE ZERO.
02 ROAS-MASTER-KEY.
05 ROAS-CURRENT-DAI.
10 ROAS-CURRENT-DISTRICT PIC X(03).
10 ROAS-CURRENT-AGENCY PIC X(03).
10 ROAS-CURRENT-INDEX PIC X(01).
|
The table fields types are
ENTY_ID --Integer
PROD_ID -- char 50
SRC_FRNCHS_VAL char 50.
While compilation I am getting an error of
Code: |
UNDEFINED OR UNUSABLE HOST VARIABLE "WS-ENTY-ID"
UNDEFINED OR UNUSABLE HOST VARIABLE "ROAS-MASTER-KEY"
|
Can anyone help on this.To me it seems that all the declarations have been made and with appropiate data types as well --still i am getting this error |
|
Back to top |
|
|
Binop B
Active User
Joined: 18 Jun 2009 Posts: 407 Location: Nashville, TN
|
|
|
|
Hi Kamlesh,
If I am correct, the equivalent of integer in DB2 is S9(09) COMP in COBOL. Please verify with the manuals...
Secondly, regarding ROAS-MASTER-KEY field, again, if my memory is correct, group variables cannot be directly referred to in a Query. You may be required to redefine the variables to use it. |
|
Back to top |
|
|
Kamlesh Kamal
New User
Joined: 16 May 2008 Posts: 36 Location: Kolkata,India
|
|
|
|
Hi Binop,
Thanks ..it helped...got it resolved.. |
|
Back to top |
|
|
Binop B
Active User
Joined: 18 Jun 2009 Posts: 407 Location: Nashville, TN
|
|
|
|
Nice to hear that... |
|
Back to top |
|
|
|