View previous topic :: View next topic
|
Author |
Message |
abhishek mitra
New User
Joined: 24 Feb 2008 Posts: 48 Location: Kolkata
|
|
|
|
Hi,
Can somebody provide me some idea on how to calculate remainders in Eazyrieve code. Also would like to hear about the Rounding off (floor and ceil) on size error in eazytrieve. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Can somebody provide me some idea on how to calculate remainders in Eazyrieve code. |
One way is to multiply and subtract. If the result is zero, there is no remainder. If the result is non-zero, that is the eremainder.
Rounding follows the simple arithmetic rules (if the value is 5 or greater, the result rounds up). For example a result of 10.78 that is rounded would become 10.8.
Where did you see floor/ceiling related to Easytrieve? If you post what you found, someone may be able to clarify. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Code: |
Format 1
[ ] { } { }
[ROUNDED ] { =} {field-name-2 }
field-name-1 [INTEGER] [TRUNCATED] {EQ} {literal-1 }
[ ] { } {arithmetic expression} |
CA-Easytrieve/Plus Reference Guide wrote: |
Use the ROUNDED option after field-name-1 to round off the fractional result of the assignment statement. Rounding takes place in the commonly accepted manner. That is, the least significant digit of the result (receiving field) has its value increased by one when the most significant digit of the excess decimal digits is greater than or equal to five. For example, if 10.75 is the value of the sending field and the receiving field has one decimal place, ROUNDED causes the receiving field to be 10.8.
Use the TRUNCATED option to truncate the result of the assignment statement. Low order digits are truncated on the right as necessary when the result is moved to the receiving field. |
|
|
Back to top |
|
|
abhishek mitra
New User
Joined: 24 Feb 2008 Posts: 48 Location: Kolkata
|
|
|
|
Thanks to both of you.
Yes Dick, I have implemented the same logic. just wanted to know anything is there in EZTRV like "REMAINDER" verb in COBOL. By the way thanks for your reply.
I mentioned about CEIL/FLOOR as that is a common mathematical term related to Round off nothing else. Sorry that my post was confusing to many.
Thanks CICS GUY for the illustration.
Regards
Abhishek |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome.
Quote: |
I mentioned about CEIL/FLOOR as that is a common mathematical term related to Round off nothing else |
Yup, i'm familiar with the terms, just not with Easytrieve |
|
Back to top |
|
|
|