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
 
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: 2504
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: 1777
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 File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm

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