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

COnvert a column with mix of hex ,char ,int to readable form


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

New User


Joined: 13 May 2020
Posts: 19
Location: India

PostPosted: Fri Oct 02, 2020 2:20 pm
Reply with quote

Hi,

I have a requirement where a table has a column varchar(193) .however this column contains data in unreadable format. It is a mix of characters ,some are readable some are not. Is there a way to decode them using SQL query
Code:


  AUDIT
 BEFORE1
 -------------------------------------------------------------------------------
  cjÃ201704240945460             0                          p             à {  ‰±1  srCPFP290      s
  ”Ux201704240947440             0                                        à {  ‰±1  srCPFP290      s
  ”Uy201704240947480             0                          ñ             à {  ‰±1  srCPFP290      s
  ÝXi201001221110320             0                      Ý       †         r {  §
  ÝXÆ201001221110320             0                      Ý       Ü         r {  §
  úzž200610081016330             0                      Û       Ó         Z    ž
  úz 200610081016330             0                      Û      ±÷         Z    ž
  úz¡200610081016330             0                      Û      }˜         Z    ž
Back to top
View user's profile Send private message
Apoorva

New User


Joined: 28 Jan 2020
Posts: 49
Location: India

PostPosted: Fri Oct 02, 2020 6:30 pm
Reply with quote

shub2204 wrote:
Hi,

I have a requirement where a table has a column varchar(193) .however this column contains data in unreadable format. It is a mix of characters ,some are readable some are not. Is there a way to decode them using SQL query
Code:



CHAR data is CHAR data, and there is no way to decode them. You can decode only numeric binary, decimal or floating point data types, and not CHAR data types. If you think what you are seeing is incorrect then you should probably check the source of that data.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2017
Location: USA

PostPosted: Sun Oct 04, 2020 6:30 pm
Reply with quote

Display your column as hexadecimal value.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Sun Oct 04, 2020 11:41 pm
Reply with quote

You can try either of this ,
1. Fix the source if that’s not what you want.
2. Try UNHEX or HEX
3. Db2 has build in encoding and decoding feature , explore it.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2017
Location: USA

PostPosted: Mon Oct 05, 2020 12:07 am
Reply with quote

In general, Software Development is very, very different from playing computer games.

In both cases one needs to click many buttons on computer, and/or move and click a mouse, or other pointing device. Everything else is different in those two activities.

The base to start Software Development should be: good knowledge of Information Technology basics, including algorithms, data processing, and many, many others.

Please, do not seek for an IT job as soon as you became an expert in a few of computer games. icon_pai.gif icon_axe.gif
Back to top
View user's profile Send private message
shub2204

New User


Joined: 13 May 2020
Posts: 19
Location: India

PostPosted: Tue Oct 06, 2020 5:46 pm
Reply with quote

Thanks all for the lovely feedback

i have sorted it out and able to display data. wrote down a cobol code for the same
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top