View previous topic :: View next topic
|
Author |
Message |
pkmurali Warnings : 1 Active User
Joined: 15 Dec 2005 Posts: 271
|
|
|
|
Hi All
I try to code the below sql
Code: |
Exec SQL
Select char(x:hv1) into :hv2 from sysibm.sysdummy1
End-exec.
01 hv1 x(02) value '28'.
01 hv2 x(01).
|
But I am getting sqlcode -440 . If I run the same query in SPUFI . I am getting the required result. How to resolve this ? |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Perhaps the DB2 that you run your SPUFI against is not the same as the one you run your 'other' query against and the two setups are not identical? |
|
Back to top |
|
|
pkmurali Warnings : 1 Active User
Joined: 15 Dec 2005 Posts: 271
|
|
|
|
The difference is X'28' used in spufi,where as in program it is host variable. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
from the messages manual
Quote: |
-440 NO AUTHORIZED routine-type BY THE NAME routine-name HAVING COMPATIBLE ARGUMENTS WAS FOUND |
meditating on the routine-type and routine-name should give You a hint on how to proceed |
|
Back to top |
|
|
pkmurali Warnings : 1 Active User
Joined: 15 Dec 2005 Posts: 271
|
|
|
|
Apologies it is not -440 it is -420. Is there any issue in my host variable declaration? BX'28' is 1 byte. But I declared 2 bytes. Is it possible in Cobol to convert 2 bytes to 1 byte. In SPUFI SQL I have used X'28'. Please correct me if I am wrong. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
pkmurali wrote: |
If I run the same query in SPUFI . I am getting the required result. |
pkmurali wrote: |
The difference is X'28' used in spufi,where as in program it is host variable. |
If there is a difference, then IT IS NOT THE SAME !!!!! |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
pkmurali wrote: |
Code: |
Select char(x:hv1) into :hv2 from sysibm.sysdummy1
01 hv1 x(02) value '28'.
01 hv2 x(01).
|
|
Because hv1 has value '28', then char(x:hv1) is equivalent to char(x'28')
Is that really what you think ??? |
|
Back to top |
|
|
|