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
 

 

Result of decimal multiplication may cause overflow

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
bhaskar_kanteti

Active User


Joined: 01 Feb 2007
Posts: 120
Location: USA

PostPosted: Thu Aug 21, 2008 10:01 am    Post subject: Result of decimal multiplication may cause overflow
Reply with quote

Hi,

In my STORED PROC i had fetch query as follows:

Code:

EXEC SQL                                       
                                               
    DECLARE CSR1 CURSOR WITH RETURN FOR
                                               
    SELECT DISTINCT                             
         DCLGEN1.BRAND                     
       ,(CASE                                         
        WHEN DCLGEN1.ACCOUNT_TYPE = 'XX' THEN   
        DCLGEN2.AMOUNT                       
        ELSE                                         
        (CASE                                         
        WHEN(DCLGEN1.AMOUNT1 + DCLGEN1.AMOUNT2
              >= 0                                   
        THEN 0                                       
        ELSE                                         
        ((DCLGEN1.AMOUNT1 + DCLGEN1.AMOUNT2)
         *-1.0)                                       
        END)END) AS AMOUNT                   
        .............


In the above sql there is an arthematic calculation as
(DCLGEN1.AMOUNT1 + DCLGEN1.AMOUNT2) * -1.0

When we bind the element i am getting the following warning.

Code:

DSNX104I  -DOA1 BIND SQL WARNING
          USING GRP AUTHORITY
          PLAN=(NOT APPLICABLE)
          DBRM=ZKCAFQ07
          STATEMENT=152
          THE RESULT OF DECIMAL MULTIPLICATION
          MAY CAUSE OVERFLOW


What changes to be done for this arthematic calculation inorder not to get this warning.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Aug 21, 2008 10:26 am    Post subject:
Reply with quote

you might look at the scalar built-in function MULTIPLY_ALT. It might apply.
Back to top
View user's profile Send private message
bhaskar_kanteti

Active User


Joined: 01 Feb 2007
Posts: 120
Location: USA

PostPosted: Thu Aug 21, 2008 11:02 am    Post subject: Reply to: Result of decimal multiplication may cause overflo
Reply with quote

Hi Dick Brenholtz,

MULTIPLY_ALT worked for my requirement.
Thank you so much.
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 JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts scheduling between OPC and TWS give u... nsbl IBM Tools 4 Sun Mar 12, 2017 5:35 pm
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts ESQA overflow - high ECSA utilization vasanthz All Other Mainframe Topics 1 Thu Dec 29, 2016 7:06 am


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