Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
abhishek mitra

New User

Joined: 24 Feb 2008
Posts: 48
Location: Kolkata

 Posted: Wed Mar 25, 2009 6:57 pm    Post subject: mathematical functions in Eazytrieve 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.

dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

Posted: Wed Mar 25, 2009 10:12 pm    Post subject:

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.
CICS Guy

Senior Member

Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

Posted: Wed Mar 25, 2009 10:28 pm    Post subject:

 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.
abhishek mitra

New User

Joined: 24 Feb 2008
Posts: 48
Location: Kolkata

 Posted: Thu Mar 26, 2009 10:39 am    Post subject: 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
dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

Posted: Thu Mar 26, 2009 10:43 am    Post subject:

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
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm Regd Date Functions in Syncsort muralikrishnan_new SYNCSORT 2 Fri Jul 01, 2016 8:21 pm Use of DLI functions CHANGE ? Payilagam Chennai IMS DB/DC 3 Wed Jan 01, 2014 9:24 pm Aggregate functions in File-AID for DB2. pradeean Compuware & Other Tools 6 Fri Jun 14, 2013 1:33 pm Is it possible to Read a RRDS file Us... scorp_rahul23 CLIST & REXX 2 Wed Apr 24, 2013 7:24 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us