MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PLI - How does Scaling factor is used in DIVIDE Built-in?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
mkusamy
Beginner


Joined: 07 Nov 2008
Posts: 9
Topics: 6

PostPosted: Mon Jan 12, 2009 6:22 am    Post subject: PLI - How does Scaling factor is used in DIVIDE Built-in? Reply with quote

Can any one please explain How the scaling factor is being used and affecting precision of DIVIDE Built-in?

Code:
DCL A  FIXED BIN(31) INIT( 45800 );
DCL B  FIXED BIN(31) INIT( 2 );
PUT SKIP LIST( DIVIDE(A,B,15,9) );

Above code abended with S0CA (FIXEDOVERFLOW) but ran fine when scaling factor was less than 7.

We are using PLI 3.5 and its Refernce manual states as below

Quote:
DIVIDE returns the quotient of x/y with a precision specified by p and q. The base, scale, and mode of the result follow the rules for expression evaluation unless overruled by the PRECTYPE compiler option.

DIVIDE(x,y,p[,q])

x Expression.
y Expression. If y = 0, the ZERODIVIDE condition is raised.
p Restricted expression specifying the number of digits to be maintained throughout the operation.
q Restricted expression specifying the scaling factor of the result. For a fixed-point result, if q is omitted, a scaling factor of zero is the default. For a floating-point result, q must be omitted.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group