Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Rounding off for a float data type

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Interview Questions
Author Message
Kamlesh Kamal

New User


Joined: 16 May 2008
Posts: 3
Location: Kolkata,India

PostPosted: Sat Jun 07, 2008 2:41 pm    Post subject: Rounding off for a float data type
Reply with quote

Hi

My requirement is to round off a float value through SQL query .Viz (12.51 divided by 21.95 = 0.56993). The result should be 0.570, not 0.569. As of now the query that i have is
EXEC SQL
UPDATE PRPL
SET PRPL_POUT_RT =
(CASE
WHEN (SCHA_AMT + SCHB_AMT+
NPROP_AMT) <> 0 AND
(SCHA_GDC_AMT + SCHB_GDC_AMT +
NPROP_GDC_AMT) <> 0
THEN
DECIMAL(
FLOAT (
(SCHA_AMT + PRPL_SCHB_AMT+
NPROP_AMT)/
FLOAT(
(SCHA_GDC_AMT + SCHB_GDC_AMT +
NPROP_GDC_AMT))),12,3)
ELSE 0.0
END)


What modification is needed for this work as required.
Back to top
View user's profile Send private message
References
PostPosted: Sat Jun 07, 2008 2:41 pm    Post subject: Re: Rounding off for a float data type Reply with quote

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 2560
Location: italy

PostPosted: Sat Jun 07, 2008 2:49 pm    Post subject: Reply to: Rounding off for a float data type
Reply with quote

deleted duplicate post
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Interview Questions All times are GMT + 6 Hours
Page 1 of 1