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

Need to convert binary value to numeric while using cast fun


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

New User


Joined: 10 Jun 2005
Posts: 21
Location: Mumbai

PostPosted: Thu Dec 22, 2011 10:52 pm
Reply with quote

am trying to Unload the data from DB2 table to Flat File using Unload Utility. While doing the Unload, I need to convert a field from binary data type from DB2 to Numeric value corresponding cobol Clause.

I tried to use the Cast Function like CAST(Field name) As Interger and CAST(Field name) As decimal (4,0) But I am getting the low value

Is there any way to get the result as a numeric

I might have less knowledge about db2 but its a requirement for me
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Dec 22, 2011 11:00 pm
Reply with quote

This should be easy enough to accomplish in COBOL, unless the binary-field (for whatever reason) is of an unsupported length that COBOL can't handle. How many bytes is the binary-field and what's its maximum value (please post value in hex).

When you say NUMERIC, does the binary-field need to be converted to Packed-Decimal or Display-Numeric?

What have you tried?

Mr. Bill
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Dec 22, 2011 11:31 pm
Reply with quote

SHAILESH OZA wrote:
am trying to Unload the data from DB2 table to Flat File using Unload Utility. While doing the Unload, I need to convert a field from binary data type from DB2 to Numeric value corresponding cobol Clause.

I tried to use the Cast Function like CAST(Field name) As Interger and CAST(Field name) As decimal (4,0) But I am getting the low value

Is there any way to get the result as a numeric

I might have less knowledge about db2 but its a requirement for me

Despite a presumed 6½ years in IT (as evinced by your join date) and a claim to DB2 in your profile skillset, you pretty conclusively proved in this thread -- where you asked virtually the same question -- that you don't know what you're talking about. Don't you think that it's time to get out of the field?
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 Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
No new posts convert file from VB to FB and use tr... DFSORT/ICETOOL 8
Search our Forums:

Back to Top