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: 246

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: 2020
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: 246

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: 10478
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: 246

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: 1284
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: 1284
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
This topic is locked: you cannot edit posts or make replies. Issue in suppressing leading zeros &a... Vijay_Sirisha COBOL Programming 21 Thu Jun 07, 2018 8:01 pm
No new posts VBS to VB in COBOL and JCL srajendran2 COBOL Programming 12 Fri Jun 01, 2018 3:04 am
This topic is locked: you cannot edit posts or make replies. Rexx code to find greater then symobl... Bharath Vikraman CLIST & REXX 8 Tue May 29, 2018 9:40 am
No new posts SYSADATA - COBOL - Structure displace... ganasrinivasan COBOL Programming 3 Thu May 24, 2018 9:45 pm
No new posts How can I convert charactor to fixed ... liying DFSORT/ICETOOL 7 Tue May 22, 2018 3:35 pm

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