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
 
Want to insert hexadecimal value by update sql

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Want to insert hexadecimal value by update sql
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: 6968
Location: porcelain throne

PostPosted: Mon Apr 06, 2009 7:50 pm    Post subject:
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

Site Director


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

PostPosted: Mon Apr 06, 2009 9:33 pm    Post subject:
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    Post subject: Reply to: Want to insert hexadecimal value by update sql
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    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 Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm

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