Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to convert 2 bytes into single byte in Cobol db2 program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 259

PostPosted: Fri May 25, 2018 1:41 pm    Post subject: How to convert 2 bytes into single byte in Cobol db2 program
Reply with quote

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
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2126
Location: UK

PostPosted: Fri May 25, 2018 5:43 pm    Post subject: Reply to: How to convert 2 bytes into single byte in Cobol db2 program
Reply with quote

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
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 259

PostPosted: Fri May 25, 2018 6:01 pm    Post subject:
Reply with quote

The difference is X'28' used in spufi,where as in program it is host variable.
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10543
Location: italy

PostPosted: Fri May 25, 2018 6:07 pm    Post subject: Reply to: How to convert 2 bytes into single byte in Cobol db2 program
Reply with quote

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
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 259

PostPosted: Sat May 26, 2018 10:55 am    Post subject:
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1303
Location: Israel

PostPosted: Mon May 28, 2018 9:22 pm    Post subject:
Reply with quote

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 !!!!! icon_evil.gif sterb050.gif
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1303
Location: Israel

PostPosted: Mon May 28, 2018 9:28 pm    Post subject: Re: How to convert 2 bytes into single byte in Cobol db2 program
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to process gdg in rexx program wh... pkmurali CLIST & REXX 11 Thu Dec 13, 2018 10:08 am
No new posts CICS program with Delay question MSTP CICS 2 Tue Dec 11, 2018 11:18 pm
No new posts COBOL D2 program execution without us... dipsybaby DB2 3 Mon Dec 10, 2018 2:08 pm
No new posts Convert VBA file to FB! Vignesh Sid SYNCSORT 5 Mon Dec 03, 2018 1:27 pm
No new posts calling java code(on mainframe from c... elixir1986 COBOL Programming 1 Fri Nov 30, 2018 1:57 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us