View Full Version : BIF %REM (= MoVe Remainder in RPG III)
Guest.Visitor
01-01-1995, 02:00 AM
If anyone already used this new Buit In Function, could he give an example of how to use it, or eventually an address site where I could find description of this new BIF for V4R4 ?? thanks in advance
Guest.Visitor
04-07-2000, 05:26 AM
From the IBM soft copy library ILE/RPG for AS/400 Reference -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-- =-=-=-= <pre> 4.1.1.23 %REM (Return Integer Remainder) %REM(n:m) %REM returns the remainder that results from dividing operands n by m. The two operands must be numeric values with zero decimal positions. If either operand is a packed, zoned, or binary numeric value, the result is packed numeric. If either operand is an integer numeric value, the result is integer. Otherwise, the result is unsigned numeric. Float numeric operands are not allowed. The result has the same sign as the dividend. (See also "%DIV (Return Integer Portion of Quotient)" in topic 4.1.1.6.) %REM and %DIV have the following relationship: %REM(A:B) = A - (%DIV(A:B) * B) If the operands are constants that can fit in 8-byte integer or unsigned fields, constant folding is applied to the built-in function. In this case, the %REM built-in function can be coded in the definition specifications. +------------------------------------------------------------------------------- -------------------+ ¦ ¦ ¦ ¦ ¦ DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++ ¦ ¦ * ¦ ¦ D A S 10I 0 INZ(123) ¦ ¦ D B S 10I 0 INZ(27) ¦ ¦ D DIV S 10I 0 ¦ ¦ D REM S 10I 0 ¦ ¦ D E S 10I 0 ¦ ¦ * ¦ ¦ CL0N01Factor1+++++++Opcode(E)+Extended-factor2+++++++++++++++++++++++++++ ¦ ¦ * ¦ ¦ C EVAL DIV = %DIV(A:B) ¦ ¦ C EVAL REM = %REM(A:B) ¦ ¦ C EVAL E = DIV*B + REM ¦ ¦ * Now, DIV = 4, REM = 15, E = 123 ¦ ¦ ¦ ¦ ¦ +------------------------------------------------------------------------------- -------------------+ Figure 159. %DIV and %REM Example </pre> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-- =-=-=-= John Panzenhagen
Guest.Visitor
04-07-2000, 06:28 AM
John; I have often pondered that statement from the RPG manual; If X is packed decimal and I is integer what is the type of REM(X:I) But my curiousity has never reached the level to write an RPG pgm to find out. bobh mail@bobh.to
Guest.Visitor
04-07-2000, 01:02 PM
Brian - Is it possible that you have some CISC objects in these two libraries? I believe that this would cause you to see the BACKLEVEL status for the licensed programs. If you restored QUSRSYS and QGPL (or individual objects) from a pre-V3R6 backup without specifying the 'Force object conversion' option, this could happen. If this is the case, try the STROBJCVN command against these libraries and see if that fixes your problem. (I would review the CISC/RISC roadmap V-E-R-Y carefully before using the STROBJCVN command!) HTH, Steve
Guest.Visitor
05-09-2000, 10:57 AM
Thanks Steve . It was just a matter of reinstalling QUSRSYS and QGPL from GO LIC PGMS Thanks Brian
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.