Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

mathematical functions in Eazytrieve

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
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    Post subject: mathematical functions in Eazytrieve
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

Site Director


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

PostPosted: Wed Mar 25, 2009 10:12 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Wed Mar 25, 2009 10:28 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Mar 26, 2009 10:43 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

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


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us