IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Want to insert hexadecimal value by update sql


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jitu852

New User


Joined: 30 Apr 2007
Posts: 27
Location: Hyderabad

PostPosted: Mon Apr 06, 2009 7:01 pm
Reply with quote

My requirement is to insert the hex char
070
35C
which is in ASCII looking like ' Í '.
i want to insert it by update sql but i am not getting the correct values updated .
please provide solutions help.

currently iam using

SET COLUMN_NAME = OX'05000C'

but it is not giving correct values.

When i hex on and write the 05000C' in the provided place i getting the correct value
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Apr 06, 2009 7:50 pm
Reply with quote

what is the datatype of COLUMN_NAME?

and I am not familiar with the '0X...' syntax.

are you trying to stuff packed-decimal into a column?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Apr 06, 2009 9:33 pm
Reply with quote

Hello,

Quote:
please provide solutions help.
Please provide better info for someone to be able to help. . .

How does ASCII relate to the requirement? I suspect the data when stored in the table will not be ascii. . .

Quote:
My requirement is to insert the hex char
070
35C
That is not a "hex char" - it might be 3 hex chars. . . Show the input data using HEX ON and show more than 3 bytes. . .

You need to also post the program or database definitions that match the input you post.

Maybe then someone can provide more help.
Back to top
View user's profile Send private message
Raghu navaikulam

Active User


Joined: 27 Sep 2008
Posts: 193
Location: chennai

PostPosted: Wed Apr 08, 2009 12:19 am
Reply with quote

Hi Jitu

You can convert the hex values to ASCII values using the editor.
Before going to convert the values into ASCII, you have to convert it to HEX. For converting the value into HEX, you can use the function HEX(Column name) in SQL or you can use a calculator available in the PC. For every EBCDIC character there should be two HEX representation. But you have shown only 3.
070
35C. Perhaps you may be using the decimal value 112 and 860.
Then go to the editor. Open your dataset ie. your SQL for updation.
Type HEX ON on the command prompt.
There you can see the conversion of your char into EBCDIC.

For Eg.
UPDATE T1 SET C1=234 will be converted as follows

EDCCEC4EF4ECE4CF7FFF
474 13503102530316234

Here you want to change the value 234 to ASCII value. For that convert 234 into hex and overtype the HEX value of 234(EA) in the place of F2.

EDCCEC4EF4ECE4CF7E
474 13503102530316A

Then change the mode, HEX OFF. You can see the conversion of HEX into ASCII value that you have modified.

Try it out and post your response.

Thanks and Regards
Raghu
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Insert system time/date (timestamp) u... DFSORT/ICETOOL 5
No new posts Identify Program Insert DB2 7
No new posts Insert trailer for non empty file only DFSORT/ICETOOL 6
No new posts Merge files with a key and insert a b... DFSORT/ICETOOL 6
Search our Forums:

Back to Top