IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

mathematical functions in Eazytrieve


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
abhishek mitra

New User


Joined: 24 Feb 2008
Posts: 48
Location: Kolkata

PostPosted: Wed Mar 25, 2009 6:57 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Mar 25, 2009 10:12 pm
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


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

PostPosted: Wed Mar 25, 2009 10:28 pm
Reply with quote

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
View user's profile Send private message
abhishek mitra

New User


Joined: 24 Feb 2008
Posts: 48
Location: Kolkata

PostPosted: Thu Mar 26, 2009 10:39 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Mar 26, 2009 10:43 am
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts SQLCODE = -122 while using the scalar... DB2 4
No new posts DSNTIAUL and DB2 Scalar Functions DB2 17
No new posts Trying to use sort to do two function... DFSORT/ICETOOL 14
No new posts SUBSTR for Date functions DB2 4
No new posts Regd Date Functions in Syncsort SYNCSORT 2
Search our Forums:

Back to Top