Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need to convert binary value to numeric while using cast fun

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Need to convert binary value to numeric while using cast fun
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Thu Dec 22, 2011 11:00 pm    Post subject: Reply to: Need to convert binary value to numeric while usin
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: 1755
Location: Bloomington, IL

PostPosted: Thu Dec 22, 2011 11:31 pm    Post subject: Re: Need to convert binary value to numeric while using cast
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    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 Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts resume binary ftp in z/os meykh2014 All Other Mainframe Topics 6 Sun Jan 22, 2017 10:01 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us