title: From Hex Value to EBCDIC in DB2 for iSeries
body: <p>I have HEX data like this (F9F9F9F9) returned from a query. When I checked from IBM link : 
  <a href="https://www.ibm.com/support/knowledgecenter/en/SS2MB5_14.1.0/com.ibm.xlf141.bg.doc/language_ref/asciit.html" rel="nofollow noreferrer">https://www.ibm.com/support/knowledgecenter/en/SS2MB5_14.1.0/com.ibm.xlf141.bg.doc/language_ref/asciit.html</a></p>
  
  <p>F9 = 9 and F9 = 9</p>
  
  <p>Here I should get result as 9999</p>
  
  <p>I jhave around 1000 hex records like this in a table.</p>
  
  <p>How can I convert this hex values to it corrsponding EBCDIC ?</p>
  
  <p>I tried like :</p>
  
  <pre><code>  select cast(col char(2) as codebase(37)) from table
  </code></pre>
  
  <p>How ever, its not working.
        THis link is also not working: I'm not sure if its a cobol code or DB2 script. : <a href="http://www.ibmmainframeforum.com/db2/topic8785.html" rel="nofollow noreferrer">http://www.ibmmainframeforum.com/db2/topic8785.html</a></p>
  
  <p>Please help.Thanks.</p>